mirror of
https://github.com/curl/curl.git
synced 2026-08-25 09:43:32 +03:00
transfer: move retrycount from connect struct to easy handle
This flag was applied to the connection struct that is released on retry. These changes move the retry counter into Curl_easy struct that lives across retries and retains the new connection. Reported-by: Cherish98 on github Fixes #5794 Closes #5800
This commit is contained in:
parent
43c68d842e
commit
50dd05a552
2 changed files with 6 additions and 3 deletions
|
|
@ -1804,12 +1804,14 @@ CURLcode Curl_retry_request(struct connectdata *conn,
|
|||
}
|
||||
if(retry) {
|
||||
#define CONN_MAX_RETRIES 5
|
||||
if(conn->retrycount++ >= CONN_MAX_RETRIES) {
|
||||
if(data->state.retrycount++ >= CONN_MAX_RETRIES) {
|
||||
failf(data, "Connection died, tried %d times before giving up",
|
||||
CONN_MAX_RETRIES);
|
||||
data->state.retrycount = 0;
|
||||
return CURLE_SEND_ERROR;
|
||||
}
|
||||
infof(conn->data, "Connection died, retrying a fresh connect\n");
|
||||
infof(conn->data, "Connection died, retrying a fresh connect\
|
||||
(retry count: %d)\n", data->state.retrycount);
|
||||
*url = strdup(conn->data->change.url);
|
||||
if(!*url)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue