]> granicus.if.org Git - curl/commitdiff
multi: Fix error handling in the SENDPROTOCONNECT state
authorMichael Kaufmann <mail@michael-kaufmann.ch>
Thu, 25 Oct 2018 11:07:03 +0000 (13:07 +0200)
committerMichael Kaufmann <mail@michael-kaufmann.ch>
Sat, 27 Oct 2018 11:03:50 +0000 (13:03 +0200)
If Curl_protocol_connect() returns an error code,
handle the error instead of switching to the next state.

Closes #3170

lib/multi.c

index 7c691a1b84de29f6ab5eeab576a92e684bcba0a6..0db2a97308c64fede76b372a450ab1a363857177 100644 (file)
@@ -1608,7 +1608,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
 
     case CURLM_STATE_SENDPROTOCONNECT:
       result = Curl_protocol_connect(data->easy_conn, &protocol_connect);
-      if(!protocol_connect)
+      if(!result && !protocol_connect)
         /* switch to waiting state */
         multistate(data, CURLM_STATE_PROTOCONNECT);
       else if(!result) {