-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
CURLOPT_READFUNCTION not called following empty POST #10313
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
Comments
This looks like expected behaviour to me. You set CURLOPT_POSTFIELDSIZE=0 for
the first request but you don't change it for the second request, so it sends 0
for that one, too.
|
Thanks @dfandrich for looking into this and replying so fast. |
I believe you need to set CURLOPT_POSTFIELDSIZE to -1 to get that behaviour.
|
Yes! That solves it. The documentation is a bit confusing here - CURLOPT_POSTFIELDSIZE only states that So, I'll do a bit more testing and then close this issue. |
Reported-by: RanBarLavie on github Closes #10313
Reported-by: RanBarLavie on github Closes #10313
Reported-by: RanBarLavie on github Closes curl#10313
Problem Description
My application uses libcurl to send two POST requests, one after the other, over the same connection.
The 1st request goes through and receives a response, as expected.
For some reason, the 2nd request only sends out the header. It seems libcurl never calls the callback function to consume the content.
Reproduce
The problem can be reproduced like this:
Output:
And that's where program execution hangs, instead of sending out the message body.
Debug:
reproduce.txt
Workaround
Interestingly, the problem is eliminated by changing the 1st request to send some content. Even 1 byte does the trick, like this for example:
The fact that the problem (in the 2nd request) is fixed just by setting some content in the body of the 1st request makes this look like a bug.
This is the output with the workaround in place:
workaround.txt
Version
libcurl version: 7.87.0
[curl -V output]
Operating System
Any insight will be appreciated. I will be happy to provide more information as needed.
Thank you!
The text was updated successfully, but these errors were encountered: