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

tcp_nodelay on ClientBuilder does not actually set TCP_NODELAY #2061

Closed
abls opened this issue Dec 8, 2023 · 0 comments
Closed

tcp_nodelay on ClientBuilder does not actually set TCP_NODELAY #2061

abls opened this issue Dec 8, 2023 · 0 comments

Comments

@abls
Copy link
Contributor

abls commented Dec 8, 2023

When trying to set nodelay on a ClientBuilder (e.g. reqwest::Client::builder().tcp_nodelay(true)), the resulting clients that are built do not have TCP_NODELAY set on the sockets they use. This happens when an http connection is made and either the default features are enabled or the rustls-tls feature is enabled. Also note that tcp_nodelay(true) works as intended when default features are disabled and rustls-tls is not enabled.

Here is where ClientBuilder creates the HttpConnector it eventually passes to one of the Connector::new functions towards the end of that scope without ever configuring the HttpConnector beyond setting a timeout. Only one of those Connector::new functions sets TCP_NODELAY here, and that only get called when the __tls feature is disabled. An easy fix would be to simply add that line to the other Connector:new functions such as under this line.

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

No branches or pull requests

1 participant