I'm diagnosing a weird networking problem, which (I think) I've narrowed down to misbehaving HTTP clients or servers and some HTTP1.1 pipelining and / or Nagle's algorithm interaction. I'm trying to disable TCP_NODELAY in curl as a test.
Curl's man page says:
--tcp-nodelay
Turn on the TCP_NODELAY option. See the curl_easy_setopt(3) man page for details about this option.
Since 7.50.2, curl sets this option by default and you need to explicitly switch it off if you don't want it on.
Added in 7.11.2.
It then never explains how to explicitly switch it off. I tried setting export CURLOPT_TCP_NODELAY=0 in the environment, but curl still mentions in its output:
* TCP_NODELAY set
Searching the internet or Stackoverflow is also not giving me an answer.
So how can I turn it off?
I should have read the manual a little better. It says:
In general, all boolean options are enabled with --option and yet again
disabled with --no-option. That is, you use the exact same option name but
prefix it with "no-". However, in this list we mostly only list and show
the --option version of them. (This concept with --no options was added in
7.19.0. Previously most options were toggled on/off on repeated use
of the same command line option.)
So I can disable TCP_NODELAY with:
curl -v --no-tcp-nodelay <url>
And the output no longer includes the TCP_NODELAY set message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With