fix: relay with yamux connection data exceeded

This commit is contained in:
Ludovic Chenut 2024-06-27 17:00:29 +02:00
parent 69d8ffaefb
commit f676cf0c86
No known key found for this signature in database
GPG Key ID: D9A59B1907F1D50C
1 changed files with 4 additions and 3 deletions

View File

@ -258,9 +258,9 @@ suite "Circuit Relay V2":
await allFutures(src.stop(), dst.stop(), rel.stop())
asyncTest "Connection data exceeded":
ldata = 1000
ldata = 1500
proto.handler = proc(conn: Connection, proto: string) {.async.} =
check "count me the better story you know" ==
check "count me the best story you know" ==
string.fromBytes(await conn.readLp(1024))
await conn.writeLp("do you expect a lorem ipsum or...?")
check "surprise me!" == string.fromBytes(await conn.readLp(1024))
@ -281,6 +281,7 @@ suite "Circuit Relay V2":
philosophical flourish Cato throws himself upon his sword; I quietly
take to the ship."""
)
await conn.close()
rv2 = Relay.new(
reservationTTL = initDuration(seconds = ttl),
limitDuration = ldur,
@ -305,7 +306,7 @@ suite "Circuit Relay V2":
rsvp = await dstCl.reserve(rel.peerInfo.peerId, rel.peerInfo.addrs)
conn = await src.dial(dst.peerInfo.peerId, @[addrs], customProtoCodec)
await conn.writeLp("count me the better story you know")
await conn.writeLp("count me the best story you know")
check:
"do you expect a lorem ipsum or...?" ==
string.fromBytes(await conn.readLp(1024))