curl: fix --upload-file . hangs if delay in STDIN #4599
Conversation
4669808
to
dd6e15c
/* 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); |
bagder
Nov 15, 2019
Member
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! 😢
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!
jpschroeder
Nov 15, 2019
Author
Contributor
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.
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.
jpschroeder
Nov 15, 2019
•
Author
Contributor
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.
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.
jpschroeder
Nov 17, 2019
Author
Contributor
Regarding 3 above. I added the busy read checking to the parallel CURLOPT_XFERINFOFUNCTION
handler also.
Regarding 3 above. I added the busy read checking to the parallel CURLOPT_XFERINFOFUNCTION
handler also.
jpschroeder
Nov 22, 2019
Author
Contributor
Regarding 1 above. I added a return code to the progress callback that will cause libcurl to continue executing the default progress function.
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
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
ff0be2c
to
ce685f3
I like the |
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