From 9a2cbf30b81a2b57149bb20e78e2e4cb5c2ff389 Mon Sep 17 00:00:00 2001 From: John Schroeder Date: Tue, 26 Nov 2019 09:16:19 +0100 Subject: 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 --- src/tool_cb_rea.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/tool_cb_rea.h') diff --git a/src/tool_cb_rea.h b/src/tool_cb_rea.h index fe744e8f7..5f7e483a3 100644 --- a/src/tool_cb_rea.h +++ b/src/tool_cb_rea.h @@ -29,4 +29,12 @@ size_t tool_read_cb(void *buffer, size_t sz, size_t nmemb, void *userdata); +/* +** callback for CURLOPT_XFERINFOFUNCTION used to unpause busy reads +*/ + +int tool_readbusy_cb(void *clientp, + curl_off_t dltotal, curl_off_t dlnow, + curl_off_t ultotal, curl_off_t ulnow); + #endif /* HEADER_CURL_TOOL_CB_REA_H */ -- cgit v1.2.3