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

Allow OneShotHandler's max_dial_negotiate limit to be configurable. #1936

Merged
merged 3 commits into from
Jan 27, 2021

Conversation

wngr
Copy link
Contributor

@wngr wngr commented Jan 26, 2021

This simply moves the max_dial_negotiated field of OneShotHandler into its config (and thus making it configurable). The default is set to the formerly hard-coded value of 8.

Copy link
Contributor

@romanb romanb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@romanb romanb merged commit 8aeb7b3 into libp2p:master Jan 27, 2021
@wngr wngr deleted the oneshot-config branch January 27, 2021 09:56
@romanb
Copy link
Contributor

romanb commented Jan 27, 2021

Released as libp2p-swarm-0.27.1. Though I realised afterwards that the OneShotHandlerConfig struct is not yet #[non_exhaustive], contrary to what I thought, so theoretically there may be code that needs to be updated to compile with this patch if it makes direct use of the OneShotHandlerConfig constructor, due to the new field. I don't think it is worth yanking for that reason though, as I think most code that uses the OneShotHandler either uses the default configuration or obtains it via the Default impl for subsequent customisation. Sorry for the oversight.

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.

3 participants