curl / Mailing Lists / curl-library / Single Mail


Re: Slow Windows uploads (with patch)

From: Christian Hägele <>
Date: Tue, 24 Jul 2018 13:47:56 +0200

Am 19.07.2018, 14:18 Uhr, schrieb Daniel Jeliński <>:

> Theoretically on these systems the send buffer should be automatically
> adjusted to optimize throughput. I run a couple experiments to confirm
> that, and found that the send buffer is only adjusted if the socket is
> blocking and application buffer size is reasonably large
> (experiment1.c), and buffer stays at 8192 if the socket is nonblocking
> regardless of the application buffer size (experiment2.c).

I did a lot of network developing on Windows and you are right that it is a common mistake to set the SO_SNDBUF or SO_RCVBUF on Windows since Vista. This is done by *many* programs as a workaround for the bad implementation on Windows XP but kills performance on todays Windows.
However, so far I did not notice that this would only work for blocking sockets.

I think the correct solution would be to not set the socket-option SO_SNDBUF or SO_RCVBUF at all on Windows-Vista and newer.
I have to admit that I did not test your experimental-code, yet. But I wanted to object the merge of this PR, because I think it is not needed to use the SIO_IDEAL_SEND_BACKLOG_QUERY at all.

Maybe somebody else on this Mailing-List can share their experience.



Received on 2018-07-24