summaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorStefan Yohansson <sy.fen0@gmail.com>2020-08-10 13:16:37 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-08-10 23:20:17 +0200
commit50dd05a55249c42b6a355cd0982c8e4da808b263 (patch)
tree72f5c507e4f6ecc6dcc2866c611bc69aafbb18d7 /lib/transfer.c
parent43c68d842ea78944989e420f4cea6531df0e865b (diff)
downloadgnurl-50dd05a55249c42b6a355cd0982c8e4da808b263.tar.gz
gnurl-50dd05a55249c42b6a355cd0982c8e4da808b263.tar.bz2
gnurl-50dd05a55249c42b6a355cd0982c8e4da808b263.zip
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
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 161dcfa01..a07c7af8c 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -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;