-
-
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: fix --upload-file . hangs if delay in STDIN #4599
Conversation
4669808
to
dd6e15c
Compare
/* when reading from stdin in non-blocking mode, we use the progress | ||
function to unpause a busy read */ | ||
my_setopt(curl, CURLOPT_XFERINFOFUNCTION, tool_readbusy_cb); | ||
my_setopt(curl, CURLOPT_XFERINFODATA, per); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not happy with how this will
- disable the regular default progress bar
- disable the --progress-bar option if set
- Not work for parallel transfers
... but I also don't have a very good answer on how to do this instead! 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely agree. I'm happy to explore other approaches, but I couldn't think of a better way. I wanted to put this out there to see what you guys thought.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding 2 above, It will actually honor the --progress-bar
option. I just pushed an update that adds the same busy read checking into the regular CURLOPT_XFERINFOFUNCTION
handler also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding 3 above. I added the busy read checking to the parallel CURLOPT_XFERINFOFUNCTION
handler also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding 1 above. I added a return code to the progress callback that will cause libcurl to continue executing the default progress function.
27b68c8
to
ff0be2c
Compare
Attempt to unpause a busy read in the CURLOPT_XFERINFOFUNCTION. When uploading from stdin in non-blocking mode, a delay in reading the stream (EAGAIN) causes curl to pause sending data (CURL_READFUNC_PAUSE). Prior to this change, a busy read was detected and unpaused only in the CURLOPT_WRITEFUNCTION handler. This change performs the same busy read handling in a CURLOPT_XFERINFOFUNCTION handler. Fixes: curl#2051 Reported-by: @bdry
ff0be2c
to
ce685f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the CURL_PROGRESSFUNC_CONTINUE
idea!
Attempt to unpause a busy read in the CURLOPT_XFERINFOFUNCTION. When uploading from stdin in non-blocking mode, a delay in reading the stream (EAGAIN) causes curl to pause sending data (CURL_READFUNC_PAUSE). Prior to this change, a busy read was detected and unpaused only in the CURLOPT_WRITEFUNCTION handler. This change performs the same busy read handling in a CURLOPT_XFERINFOFUNCTION handler. Fixes #2051 Closes #4599 Reported-by: bdry on github
Thanks! As you'll see, I split your commit in two: one for the library change and one for the tool change, before I merged. |
Attempt to unpause a busy read in the CURLOPT_XFERINFOFUNCTION.
When uploading from stdin in non-blocking mode, a delay in reading
the stream (EAGAIN) causes curl to pause sending data
(CURL_READFUNC_PAUSE). Prior to this change, a busy read was
detected and unpaused only in the CURLOPT_WRITEFUNCTION handler.
This change performs the same busy read handling in a
CURLOPT_XFERINFOFUNCTION handler.
Fixes: #2051
Reported-by: @bdry