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)) let conn: Connection = newConnection(newChronosStream(server, client))
conn.observedAddrs = MultiAddress.init(client.remoteAddress) conn.observedAddrs = MultiAddress.init(client.remoteAddress)
if not initiator: if not initiator:
let handlerFut = if isNil(t.handler): nil else: t.handler(conn) if not isNil(t.handler):
let connHolder: ConnHolder = ConnHolder(connection: conn, asyncCheck t.handler(conn)
connFuture: handlerFut)
# TODO: this needs rethinking, # TODO: this needs rethinking,
# currently it leaks since there # currently it leaks since there
# is no way to delete the conn on close # is no way to delete the conn on close
# let connHolder: ConnHolder = ConnHolder(connection: conn,
# connFuture: handlerFut)
# t.connections.add(connHolder) # t.connections.add(connHolder)
result = conn result = conn