mirror of
https://github.com/curl/curl.git
synced 2026-06-05 14:54:14 +03:00
curl: fix --upload-file . hangs if delay in STDIN
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
This commit is contained in:
parent
7cf18b05e0
commit
9a2cbf30b8
6 changed files with 63 additions and 4 deletions
|
|
@ -95,10 +95,18 @@ int xferinfo_cb(void *clientp,
|
|||
curl_off_t ulnow)
|
||||
{
|
||||
struct per_transfer *per = clientp;
|
||||
struct OutStruct *outs = &per->outs;
|
||||
struct OperationConfig *config = outs->config;
|
||||
per->dltotal = dltotal;
|
||||
per->dlnow = dlnow;
|
||||
per->ultotal = ultotal;
|
||||
per->ulnow = ulnow;
|
||||
|
||||
if(config->readbusy) {
|
||||
config->readbusy = FALSE;
|
||||
curl_easy_pause(per->curl, CURLPAUSE_CONT);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue