multi_runsingle: move timestamp into INIT

Setting the TIMER_STARTSINGLE timestamp first in CONNECT has the
drawback that for actions that go back to the CONNECT state, the time
stamp is reset and for the multi_socket API there's no corresponding
Curl_expire() then so the timeout logic gets wrong!

Reported-by: Brad Spencer
Bug: http://curl.haxx.se/mail/lib-2014-02/0036.html
This commit is contained in:
Daniel Stenberg 2014-02-17 23:43:31 +01:00
Родитель a21c04f391
Коммит 0b3750b5c2
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1024,6 +1024,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
if(CURLE_OK == data->result) { if(CURLE_OK == data->result) {
/* after init, go CONNECT */ /* after init, go CONNECT */
multistate(data, CURLM_STATE_CONNECT); multistate(data, CURLM_STATE_CONNECT);
Curl_pgrsTime(data, TIMER_STARTSINGLE);
result = CURLM_CALL_MULTI_PERFORM; result = CURLM_CALL_MULTI_PERFORM;
} }
break; break;
@ -1035,7 +1036,6 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
case CURLM_STATE_CONNECT: case CURLM_STATE_CONNECT:
/* Connect. We want to get a connection identifier filled in. */ /* Connect. We want to get a connection identifier filled in. */
Curl_pgrsTime(data, TIMER_STARTSINGLE);
data->result = Curl_connect(data, &data->easy_conn, data->result = Curl_connect(data, &data->easy_conn,
&async, &protocol_connect); &async, &protocol_connect);
if(CURLE_NO_CONNECTION_AVAILABLE == data->result) { if(CURLE_NO_CONNECTION_AVAILABLE == data->result) {