multi: make multi_handle_timeout use the connect timeout
For all states before MSTATE_DO the connect timeout needs to be
considered.
Regression since #13371 (be659030ba) shipped in 8.8.0
Reported-by: Deniz Sökmen
Fixes #15100
Closes #15119
This commit is contained in:
parent
8eb983318a
commit
23386872d1
11
lib/multi.c
11
lib/multi.c
@ -1663,9 +1663,9 @@ static CURLcode multi_do_more(struct Curl_easy *data, int *complete)
|
|||||||
static bool multi_handle_timeout(struct Curl_easy *data,
|
static bool multi_handle_timeout(struct Curl_easy *data,
|
||||||
struct curltime *now,
|
struct curltime *now,
|
||||||
bool *stream_error,
|
bool *stream_error,
|
||||||
CURLcode *result,
|
CURLcode *result)
|
||||||
bool connect_timeout)
|
|
||||||
{
|
{
|
||||||
|
bool connect_timeout = data->mstate < MSTATE_DO;
|
||||||
timediff_t timeout_ms = Curl_timeleft(data, now, connect_timeout);
|
timediff_t timeout_ms = Curl_timeleft(data, now, connect_timeout);
|
||||||
if(timeout_ms < 0) {
|
if(timeout_ms < 0) {
|
||||||
/* Handle timed out */
|
/* Handle timed out */
|
||||||
@ -1868,7 +1868,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||||||
/* Wait for the connect state as only then is the start time stored, but
|
/* Wait for the connect state as only then is the start time stored, but
|
||||||
we must not check already completed handles */
|
we must not check already completed handles */
|
||||||
if((data->mstate >= MSTATE_CONNECT) && (data->mstate < MSTATE_COMPLETED) &&
|
if((data->mstate >= MSTATE_CONNECT) && (data->mstate < MSTATE_COMPLETED) &&
|
||||||
multi_handle_timeout(data, nowp, &stream_error, &result, FALSE))
|
multi_handle_timeout(data, nowp, &stream_error, &result))
|
||||||
/* Skip the statemachine and go directly to error handling section. */
|
/* Skip the statemachine and go directly to error handling section. */
|
||||||
goto statemachine_end;
|
goto statemachine_end;
|
||||||
|
|
||||||
@ -2542,7 +2542,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||||||
* (i.e. CURLM_CALL_MULTI_PERFORM == TRUE) then we should do that before
|
* (i.e. CURLM_CALL_MULTI_PERFORM == TRUE) then we should do that before
|
||||||
* declaring the connection timed out as we may almost have a completed
|
* declaring the connection timed out as we may almost have a completed
|
||||||
* connection. */
|
* connection. */
|
||||||
multi_handle_timeout(data, nowp, &stream_error, &result, FALSE);
|
multi_handle_timeout(data, nowp, &stream_error, &result);
|
||||||
}
|
}
|
||||||
|
|
||||||
statemachine_end:
|
statemachine_end:
|
||||||
@ -2685,8 +2685,7 @@ CURLMcode curl_multi_perform(struct Curl_multi *multi, int *running_handles)
|
|||||||
if(data->mstate == MSTATE_PENDING) {
|
if(data->mstate == MSTATE_PENDING) {
|
||||||
bool stream_unused;
|
bool stream_unused;
|
||||||
CURLcode result_unused;
|
CURLcode result_unused;
|
||||||
if(multi_handle_timeout(data, &now, &stream_unused, &result_unused,
|
if(multi_handle_timeout(data, &now, &stream_unused, &result_unused)) {
|
||||||
FALSE)) {
|
|
||||||
infof(data, "PENDING handle timeout");
|
infof(data, "PENDING handle timeout");
|
||||||
move_pending_to_connect(multi, data);
|
move_pending_to_connect(multi, data);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user