]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
multi: when erroring in TOOFAST state, act as for PERFORM
authorDaniel Stenberg <daniel@haxx.se>
Thu, 17 Dec 2020 10:17:55 +0000 (11:17 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 17 Dec 2020 12:57:27 +0000 (13:57 +0100)
When failing in TOOFAST, the multi_done() wasn't called so the same
cleanup and handling wasn't done like when it fails in PERFORM, which in
the case of FTP could mean that the control connection wouldn't be
marked as "dead" for the CURLE_ABORTED_BY_CALLBACK case. Which caused
ftp_disconnect() to use it to send "QUIT", which could end up waiting
for a response a long time before giving up!

Reported-by: Tomas Berger
Fixes #6333
Closes #6337

lib/multi.c

index 86e36be4ac4c2bdf5feefe04a0a9548e69a79313..bf439bb8ea6647d92d4763847b8207ac2375f326 100644 (file)
@@ -2079,7 +2079,15 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
       else
         result = Curl_speedcheck(data, *nowp);
 
-      if(!result) {
+      if(result) {
+        if(!(data->conn->handler->flags & PROTOPT_DUAL) &&
+           result != CURLE_HTTP2_STREAM)
+          streamclose(data->conn, "Transfer returned error");
+
+        Curl_posttransfer(data);
+        multi_done(data, result, TRUE);
+      }
+      else {
         send_timeout_ms = 0;
         if(data->set.max_send_speed > 0)
           send_timeout_ms =