make sure the code deals with failures on the DO_MORE state properly

This commit is contained in:
Daniel Stenberg 2007-11-03 14:44:38 +00:00
parent 2ec8f77f21
commit 51009a40b4

View File

@ -1057,7 +1057,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
/* protocol-specific connect phase */ /* protocol-specific connect phase */
easy->result = Curl_protocol_connecting(easy->easy_conn, easy->result = Curl_protocol_connecting(easy->easy_conn,
&protocol_connect); &protocol_connect);
if(protocol_connect) { if((easy->result == CURLE_OK) && protocol_connect) {
/* after the connect has completed, go WAITDO */ /* after the connect has completed, go WAITDO */
multistate(easy, CURLM_STATE_WAITDO); multistate(easy, CURLM_STATE_WAITDO);
result = CURLM_CALL_MULTI_PERFORM; result = CURLM_CALL_MULTI_PERFORM;
@ -1181,15 +1181,20 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
if(CURLE_OK == easy->result) if(CURLE_OK == easy->result)
easy->result = Curl_readwrite_init(easy->easy_conn); easy->result = Curl_readwrite_init(easy->easy_conn);
else
/* Remove ourselves from the send pipeline */ /* No need to remove ourselves from the send pipeline here since that
Curl_removeHandleFromPipeline(easy->easy_handle, is done for us in Curl_done() */
easy->easy_conn->send_pipe);
if(CURLE_OK == easy->result) { if(CURLE_OK == easy->result) {
multistate(easy, CURLM_STATE_DO_DONE); multistate(easy, CURLM_STATE_DO_DONE);
result = CURLM_CALL_MULTI_PERFORM; result = CURLM_CALL_MULTI_PERFORM;
} }
else {
/* failure detected */
Curl_posttransfer(easy->easy_handle);
Curl_done(&easy->easy_conn, easy->result, FALSE);
disconnect_conn = TRUE;
}
} }
break; break;