mirror of
https://github.com/curl/curl.git
synced 2026-04-27 06:12:12 +03:00
tool: fix retries in parallel mode
Verify that curl's --retry behaviour works - test 502 in serial, works - test 502 in parallel, hangs forver, test skipped by default - test 401, no retries done Fixes #20669 Reported-by: BlackFuffey on github Closes #21206
This commit is contained in:
parent
c54a3319ad
commit
78e281bf6a
2 changed files with 67 additions and 0 deletions
|
|
@ -1723,6 +1723,29 @@ static CURLcode parallel_event(struct parastate *s)
|
|||
&s->still_running);
|
||||
|
||||
while(!s->mcode && (s->still_running || s->more_transfers)) {
|
||||
|
||||
if(!s->still_running && s->more_transfers) {
|
||||
curl_off_t nxfers;
|
||||
/* None are running, but there may be more ready to run. Try
|
||||
* to add more when possible. */
|
||||
s->result = add_parallel_transfers(s->multi, s->share,
|
||||
&s->more_transfers,
|
||||
&s->added_transfers);
|
||||
if(s->result)
|
||||
break;
|
||||
if(s->more_transfers) {
|
||||
/* There are still more transfers, so not all were added. If we
|
||||
* did not add *any*, it means there is nothing to do until time
|
||||
* passes and a transfer becomes ready to add.
|
||||
* Avoid busy looping by taking a small break. */
|
||||
CURLMcode mcode = curl_multi_get_offt(
|
||||
s->multi, CURLMINFO_XFERS_CURRENT, &nxfers);
|
||||
if(!mcode && !nxfers) {
|
||||
/* None have been added, must be waiting on a timeout */
|
||||
curlx_wait_ms(500);
|
||||
}
|
||||
}
|
||||
}
|
||||
#if DEBUG_UV
|
||||
curl_mfprintf(tool_stderr, "parallel_event: uv_run(), "
|
||||
"mcode=%d, %d running, %d more\n",
|
||||
|
|
@ -1919,6 +1942,13 @@ static CURLcode parallel_transfers(CURLSH *share)
|
|||
s->wrapitup_processed = TRUE;
|
||||
}
|
||||
}
|
||||
else if(s->more_transfers) {
|
||||
s->result = add_parallel_transfers(s->multi, s->share,
|
||||
&s->more_transfers,
|
||||
&s->added_transfers);
|
||||
if(s->result)
|
||||
break;
|
||||
}
|
||||
|
||||
s->mcode = curl_multi_poll(s->multi, NULL, 0, 1000, NULL);
|
||||
if(!s->mcode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue