Skip to content

Commit

Permalink
Reproducing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrsantos committed Nov 6, 2023
1 parent 1ea3f3a commit 4f6ed3b
Show file tree
Hide file tree
Showing 3 changed files with 404 additions and 395 deletions.
1 change: 1 addition & 0 deletions libp2p/builders.nim
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ proc newStandardSwitch*(
.withMaxConnsPerPeer(maxConnsPerPeer)
.withPeerStore(capacity=peerStoreCapacity)
.withMplex(inTimeout, outTimeout)
.withYamux()
.withTcpTransport(transportFlags)
.withNameResolver(nameResolver)
.withNoise()
Expand Down
1 change: 1 addition & 0 deletions libp2p/muxers/yamux/yamux.nim
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ method handle*(m: Yamux) {.async, gcsafe.} =
if header.streamId in m.flushed:
m.flushed.del(header.streamId)
if header.streamId mod 2 == m.currentId mod 2:
debug "Peer used our reserved stream id, skipping", id=header.streamId, currentId=m.currentId, peerId=m.connection.peerId
raise newException(YamuxError, "Peer used our reserved stream id")
let newStream = m.createStream(header.streamId, false)
if m.channels.len >= m.maxChannCount:
Expand Down
Loading

0 comments on commit 4f6ed3b

Please sign in to comment.