disable storing connections on internal table

This commit is contained in:
Dmitriy Ryajov 2020-04-04 20:44:44 -06:00
parent 87b35de83e
commit 5a657c9264
1 changed files with 4 additions and 3 deletions

View File

@ -30,12 +30,13 @@ proc connHandler*(t: Transport,
let conn: Connection = newConnection(newChronosStream(server, client))
conn.observedAddrs = MultiAddress.init(client.remoteAddress)
if not initiator:
let handlerFut = if isNil(t.handler): nil else: t.handler(conn)
let connHolder: ConnHolder = ConnHolder(connection: conn,
connFuture: handlerFut)
if not isNil(t.handler):
asyncCheck t.handler(conn)
# TODO: this needs rethinking,
# currently it leaks since there
# is no way to delete the conn on close
# let connHolder: ConnHolder = ConnHolder(connection: conn,
# connFuture: handlerFut)
# t.connections.add(connHolder)
result = conn