File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 33- Use ` web-time ` instead of ` instant ` .
44 See [ PR 5347] ( https://github.com/libp2p/rust-libp2p/pull/5347 ) .
55
6+ - Fix panic in WASM caused by retrying on dial upgrade errors.
7+ See [ PR 5447] ( https://github.com/libp2p/rust-libp2p/pull/5447 ) .
8+
69## 0.44.1
710
811- Impose ` Sync ` on ` ping::Failure::Other ` .
Original file line number Diff line number Diff line change @@ -184,6 +184,18 @@ impl Handler {
184184 ) {
185185 self . outbound = None ; // Request a new substream on the next `poll`.
186186
187+ // Timer is already polled and expired before substream request is initiated
188+ // and will be polled again later on in our `poll` because we reset `self.outbound`.
189+ //
190+ // `futures-timer` allows an expired timer to be polled again and returns
191+ // immediately `Poll::Ready`. However in its WASM implementation there is
192+ // a bug that causes the expired timer to panic.
193+ // This is a workaround until a proper fix is merged and released.
194+ // See libp2p/rust-libp2p#5447 for more info.
195+ //
196+ // TODO: remove when async-rs/futures-timer#74 gets merged.
197+ self . interval . reset ( Duration :: new ( 0 , 0 ) ) ;
198+
187199 let error = match error {
188200 StreamUpgradeError :: NegotiationFailed => {
189201 debug_assert_eq ! ( self . state, State :: Active ) ;
You can’t perform that action at this time.
0 commit comments