-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
curl_setup: Disable by default recv-before-send in Windows #10409
Conversation
2154327
to
a5c1b05
Compare
Maybe just disable recv-before-send for the handshakes and use it for the data transfers? |
Of the other hand, this workaround was implemented for HTTP servers not following RFC requirements: https://www.rfc-editor.org/rfc/rfc9112#section-9.6-9 |
a5c1b05
to
99ce088
Compare
99ce088
to
668468c
Compare
668468c
to
3a41ab5
Compare
3a41ab5
to
36ce18f
Compare
36ce18f
to
aee6960
Compare
aee6960
to
53b32b0
Compare
Prior to this change a workaround for Windows to recv before every send was enabled by default. The way it works is a recv is called before every send and saves the received data, in case send fails because in Windows apparently that can wipe out the socket's internal received data buffer. This feature has led to several bugs because the way libcurl operates it waits on a socket to read or to write, and may not at all times check for buffered receive data. Two recent significant bugs this workaround caused: - Broken Schannel TLS 1.3 connections (curl#9431) - HTTP/2 arbitrary hangs (curl#10253) The actual code remains though it is disabled by default. Though future changes to connection filter buffering could improve the situation IMO it's just not tenable to manage this workaround. Ref: curl#657 Ref: curl#668 Ref: curl#720 Ref: curl#9431 Ref: curl#10253 Closes curl#10409
53b32b0
to
c2b2799
Compare
Thanks for your feedback. Yes, unfortunately premature server responses may be lost on Windows if they're followed by RST. |
Prior to this change a workaround for Windows to recv before every send was enabled by default. The way it works is a recv is called before every send and saves the received data, in case send fails because in Windows apparently that can wipe out the socket's internal received data buffer. This feature has led to several bugs because the way libcurl operates it waits on a socket to read or to write, and may not at all times check for buffered receive data. Two recent significant bugs this workaround caused: - Broken Schannel TLS 1.3 connections (curl#9431) - HTTP/2 arbitrary hangs (curl#10253) The actual code remains though it is disabled by default. Though future changes to connection filter buffering could improve the situation IMO it's just not tenable to manage this workaround. Ref: curl#657 Ref: curl#668 Ref: curl#720 Ref: curl#9431 Ref: curl#10253 Closes curl#10409
Prior to this change a workaround for Windows to recv before every send was enabled by default. The way it works is a recv is called before every send and saves the received data, in case send fails because in Windows apparently that can wipe out the socket's internal received data buffer.
This feature has led to several bugs because the way libcurl operates it waits on a socket to read or to write, and may not at all times check for buffered receive data.
Two recent significant bugs this workaround caused:
The actual code remains though it is disabled by default. Though future changes to connection filter buffering could improve the situation IMO it's just not tenable to manage this behavior, though it could possibly be handled more correctly at a higher level (eg transfer handling checks for server error response before it has completed sending its request).
Ref: #9431
Ref: #10253
Closes #xxxx
/cc @Karlson2k