Skip to content

Commit

Permalink
Properly generate events when failing to negotiate ping (#1459)
Browse files Browse the repository at this point in the history
* Properly generate events when failing to negotiate ping

* PR link
  • Loading branch information
tomaka authored Dec 11, 2023
1 parent d9b5942 commit c791ae0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/src/libp2p/connection/established/substream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,10 +1033,12 @@ where
}
Ok(multistream_select::Negotiation::Success) => {}
Ok(multistream_select::Negotiation::NotAvailable) => {
return (Some(SubstreamInner::PingOutFailed { queued_pings }), None)
read_write.wake_up_asap();
return (Some(SubstreamInner::PingOutFailed { queued_pings }), None);
}
Err(_) => {
return (Some(SubstreamInner::PingOutFailed { queued_pings }), None)
read_write.wake_up_asap();
return (Some(SubstreamInner::PingOutFailed { queued_pings }), None);
}
}
}
Expand Down Expand Up @@ -1078,6 +1080,7 @@ where
.pop_front()
.map_or(true, |expected| pong != *expected)
{
read_write.wake_up_asap();
return (Some(SubstreamInner::PingOutFailed { queued_pings }), None);
}
if queued_pings.remove(0).is_some() {
Expand Down
4 changes: 4 additions & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixed

- Fix connection being properly killed when the ping substream fails to be negotiated. ([#1459](https://github.com/smol-dot/smoldot/pull/1459))

## 2.0.13 - 2023-11-28

### Changed
Expand Down

0 comments on commit c791ae0

Please sign in to comment.