mirror of https://github.com/vacp2p/nim-libp2p.git
fix: multistream tests
This commit is contained in:
parent
e31966b6f8
commit
93a9fd203a
|
@ -8,12 +8,12 @@
|
|||
## those terms.
|
||||
|
||||
import chronos, strformat
|
||||
import ../../stream/bufferstream,
|
||||
import types,
|
||||
coder,
|
||||
nimcrypto/utils,
|
||||
../../stream/bufferstream,
|
||||
../../stream/lpstream,
|
||||
../../connection,
|
||||
nimcrypto/utils,
|
||||
types,
|
||||
coder,
|
||||
../../helpers/debug
|
||||
|
||||
const DefaultChannelSize* = DefaultBufferSize * 64 # 64kb
|
||||
|
|
|
@ -117,8 +117,8 @@ proc handleConn(s: Switch, conn: Connection): Future[Connection] {.async, gcsafe
|
|||
await s.mux(result) # mux it if possible
|
||||
|
||||
proc cleanupConn(s: Switch, conn: Connection) {.async, gcsafe.} =
|
||||
let id = if conn.peerInfo.isSome: conn.peerInfo.get().peerId.pretty else: ""
|
||||
if conn.peerInfo.isSome:
|
||||
let id = conn.peerInfo.get().peerId.pretty
|
||||
if s.muxed.contains(id):
|
||||
await s.muxed[id].close
|
||||
|
||||
|
|
|
@ -43,6 +43,9 @@ method readExactly*(s: TestSelectStream,
|
|||
cstring("\0x3na\n"),
|
||||
"\0x3na\n".len())
|
||||
|
||||
method write*(s: TestSelectStream, msg: seq[byte], msglen = -1)
|
||||
{.async, gcsafe.} = discard
|
||||
|
||||
method write*(s: TestSelectStream, msg: string, msglen = -1)
|
||||
{.async, gcsafe.} = discard
|
||||
|
||||
|
|
Loading…
Reference in New Issue