-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(relay/client): only try to forward handler events once
We currently try to forward pending handler events in the relay client behavior twice: in `handle_established_{in, out}bound_connection` and in `on_swarm_event()` (introduced in #3328). This is redundant because by the second time we try to forward it there won't be any pending event anymore. This PR removes the duplicated logic from `on_swarm_event`. Forwarding it in `handle_established_{in, out}bound_connection` is more convenient as we still have direct access to the handler there and don't need to go through the swarm. However, it requires that in `handle_established_{in, out}bound_connection` the event is also removed when the connection is relayed, in which case the event is simply discarded because the commands are only valid on direct connections. Pull-Request: #5765.
- Loading branch information
Showing
5 changed files
with
18 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name = "libp2p-relay" | |
edition = "2021" | ||
rust-version = { workspace = true } | ||
description = "Communications relaying for libp2p" | ||
version = "0.19.0" | ||
version = "0.19.1" | ||
authors = ["Parity Technologies <[email protected]>", "Max Inden <[email protected]>"] | ||
license = "MIT" | ||
repository = "https://github.com/libp2p/rust-libp2p" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters