Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Curl_easy_perform returns CURLE_OK when HTTP/1.1 connection reuse fails #2801
I did this
I'm uploading files to HTTP/1.1 endpoint over SSL using lubcurl. I'm reusing the same easy handle to allow for connection reuse. Every now and then I'm getting CURLE_OK without accompanying HTTP response. Debug logs show the following:
I expected the following
curl_easy_perform should return CURLE_SEND_FAIL_REWIND
[curl -V output]
This is a tricky one to reproduce in lab, but happens regularly in practice; the other end needs to close the connection after the initial check for dead connection but before the upload completes.
with done=true and result=CURLE_OK. I'll verify this on Monday.
Gist of code used to reproduce:
With read callback:
Also my comment above was apparently right; the following patch gives me CURLE_SEND_FAIL_REWIND:
I don't understand the code enough to know if this is the right place for this fix or not; let me know if I should file a pull request.