From 6eb60c2dc589a15ff8a3aa5961745d86044a9b78 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Aug 2016 00:48:23 +0200 Subject: transfer: return without select when the read loop reached maxcount Regression added in 790d6de48515. The was then added to avoid one particular transfer to starve out others. But when aborting due to reading the maxcount, the connection must be marked to be read from again without first doing a select as for some protocols (like SFTP/SCP) the data may already have been read off the socket. Reported-by: Dan Donahue Bug: https://curl.haxx.se/mail/lib-2016-07/0057.html --- lib/multi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/multi.c') diff --git a/lib/multi.c b/lib/multi.c index 8bb93660d..c471c48d9 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1810,6 +1810,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, { char *newurl = NULL; bool retry = FALSE; + bool comeback = FALSE; /* check if over send speed */ if((data->set.max_send_speed > 0) && @@ -1844,7 +1845,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, } /* read/write data if it is ready to do so */ - result = Curl_readwrite(data->easy_conn, data, &done); + result = Curl_readwrite(data->easy_conn, data, &done, &comeback); k = &data->req; @@ -1950,6 +1951,8 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, rc = CURLM_CALL_MULTI_PERFORM; } } + else if(comeback) + rc = CURLM_CALL_MULTI_PERFORM; free(newurl); break; -- cgit v1.2.3