don't complete futures twise
This commit is contained in:
parent
e8287a0e82
commit
2febd47e0d
|
@ -75,7 +75,7 @@ method handle*(m: Mplex) {.async, gcsafe.} =
|
|||
of MessageType.New:
|
||||
let name = cast[string](data)
|
||||
channel = await m.newStreamInternal(false, id, name)
|
||||
# debug "handle: created channel ", id = id, name = name
|
||||
debug "handle: created channel ", id = id, name = name
|
||||
if not isNil(m.streamHandler):
|
||||
let handlerFut = m.streamHandler(newConnection(channel))
|
||||
|
||||
|
|
|
@ -250,8 +250,6 @@ suite "Mplex":
|
|||
await stream.close()
|
||||
|
||||
await conn.close()
|
||||
listenFut.complete()
|
||||
dialFut.complete()
|
||||
result = true
|
||||
|
||||
check:
|
||||
|
|
|
@ -64,7 +64,6 @@ suite "Switch":
|
|||
(switch2, peerInfo2) = createSwitch(ma2)
|
||||
await switch2.start()
|
||||
let conn = await switch2.dial(peerInfo1, TestCodec)
|
||||
debug "TEST SWITCH: dial succesful"
|
||||
await conn.writeLp("Hello!")
|
||||
let msg = cast[string](await conn.readLp())
|
||||
check "Hello!" == msg
|
||||
|
|
Loading…
Reference in New Issue