Force closing keep-alive connections on old cURL#211
Conversation
cURL <7.22 seems to hold the request open if the connection is keep-alive and the buffer hasn't been filled. Changing to single connections is slightly less efficient (although unnoticable in most uses), but should fix this issue. If you need keep-alive, set the Connection header manually.
Current coverage is 92.25%@@ master #211 diff @@
==========================================
Files 21 21
Lines 1766 1768 +2
Methods 156 156
Messages 0 0
Branches 0 0
==========================================
+ Hits 1629 1631 +2
Misses 137 137
Partials 0 0
|
|
@rmccue Do you remember any additional context here around the specific version number you've identified? I'm asking because actively making use of that specific version for conditional code ended up breaking a lot of things. See #838 & https://core.trac.wordpress.org/ticket/59842 |
|
@schlessera Don't recall the context off the top of my head. I checked the cURL changelog for 7.22 and not seeing anything super relevant around keepalives, best I can see is:
Looks like 7.21.7 did have this though:
Other issues I can see that could be relevant are jonashaag/bjoern#51 and this Stack Overflow question which links https://stackoverflow.com/questions/10285700/curl-error-recv-failure-connection-reset-by-peer-php-curl Sounds like in any case based on #838, keepalive may be more generally still be broken, either with cURL in PHP or with w.org. |
cURL <7.22 seems to hold the request open if the connection is
keep-alive and the buffer hasn't been filled. Changing to single
connections is slightly less efficient (although unnoticable in most
uses), but should fix this issue.
If you need keep-alive, set the Connection header manually.