Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[swarm] MultiHandler: Respect inbound timeouts and upgrade versions. #1786

Merged
merged 3 commits into from
Oct 12, 2020

Conversation

romanb
Copy link
Contributor

@romanb romanb commented Oct 7, 2020

At the moment the ProtocolsHandler::listen_protocol() implementation of the MultiHandler discards configured timeouts and upgrade protocol versions on the inner handlers. The former results in the MultiHandler always having a default 10 second timeout on inbound substream upgrades, regardless of the configuration on the inner handlers. The latter results in the MultiHandler always using the upgrade::V1 negotiation protocol for inbound substream upgrades, which may not match what the inner handlers use for their corresponding outbound substreams - of course it should still be the same version used in all handlers, but it may not be V1. So this PR does the following:

  1. The MultiHandler uses the maximum of all configured inbound timeouts on the inner handlers. Typically these are all the same but need not necessarily be.
  2. The MultiHandler uses the upgrade::Version used by the inner handlers, unless they are not all the same, in which case a warning is logged and V1 used.

@romanb romanb merged commit 6ed92ab into libp2p:master Oct 12, 2020
@romanb romanb deleted the multihandler-patch branch October 12, 2020 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants