[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 23/264: transfer: cap retries of "dead connections" to 5
From: |
gnunet |
Subject: |
[gnurl] 23/264: transfer: cap retries of "dead connections" to 5 |
Date: |
Thu, 30 Apr 2020 16:05:26 +0200 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit f38c7290b1d57a7cad27ede73d88bfa2e8349d1a
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Mar 10 22:31:47 2020 +0100
transfer: cap retries of "dead connections" to 5
When libcurl retries a connection due to it being "seemingly dead" or by
REFUSED_STREAM, it will now only do it up five times before giving up,
to avoid never-ending loops.
Reported-by: Dima Tisnek
Bug: https://curl.haxx.se/mail/lib-2020-03/0044.html
Closes #5074
---
lib/transfer.c | 6 ++++++
lib/urldata.h | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/transfer.c b/lib/transfer.c
index e76834eb3..d02baa4c3 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1779,6 +1779,12 @@ CURLcode Curl_retry_request(struct connectdata *conn,
retry = TRUE;
}
if(retry) {
+#define CONN_MAX_RETRIES 5
+ if(conn->retrycount++ >= CONN_MAX_RETRIES) {
+ failf(data, "Connection died, tried %d times before giving up",
+ CONN_MAX_RETRIES);
+ return CURLE_SEND_ERROR;
+ }
infof(conn->data, "Connection died, retrying a fresh connect\n");
*url = strdup(conn->data->change.url);
if(!*url)
diff --git a/lib/urldata.h b/lib/urldata.h
index 4ee568fd6..374bf4371 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -1099,7 +1099,7 @@ struct connectdata {
struct http_connect_state *connect_state; /* for HTTP CONNECT */
struct connectbundle *bundle; /* The bundle we are member of */
int negnpn; /* APLN or NPN TLS negotiated protocol, CURL_HTTP_VERSION* */
-
+ int retrycount; /* number of retries on a new connection */
#ifdef USE_UNIX_SOCKETS
char *unix_domain_socket;
BIT(abstract_unix_socket);
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 09/264: smbserver: pin Python version to 2 since we are not yet 3 compatible, (continued)
- [gnurl] 09/264: smbserver: pin Python version to 2 since we are not yet 3 compatible, gnunet, 2020/04/30
- [gnurl] 10/264: impacket: some more Python 3 code compatibility updates, gnunet, 2020/04/30
- [gnurl] 08/264: cleanup: fix some text/comment typos, gnunet, 2020/04/30
- [gnurl] 05/264: tests/data: Fix some XML formatting issues in test cases, gnunet, 2020/04/30
- [gnurl] 11/264: server/getpart: make the "XML-parser" stricter, gnunet, 2020/04/30
- [gnurl] 13/264: easy: Fix curl_easy_duphandle for builds missing IPv6 that use c-ares, gnunet, 2020/04/30
- [gnurl] 17/264: ci/tests: fix and align setting TFLAGS for make test-nonflaky, gnunet, 2020/04/30
- [gnurl] 14/264: Makefile.m32: Improve windres parameter compatibility, gnunet, 2020/04/30
- [gnurl] 19/264: select: move duplicate select preparation code into Curl_select, gnunet, 2020/04/30
- [gnurl] 24/264: tests/README: add note about manually installing python-impacket, gnunet, 2020/04/30
- [gnurl] 23/264: transfer: cap retries of "dead connections" to 5,
gnunet <=
- [gnurl] 25/264: ci/tests: install impacket for SMB tests on FreeBSD using CirrusCI, gnunet, 2020/04/30
- [gnurl] 20/264: select: fix 'pending_ms' is assigned a value that is never used, gnunet, 2020/04/30
- [gnurl] 27/264: gskit: use our internal select wrapper for portability, gnunet, 2020/04/30
- [gnurl] 29/264: ci/tests: fix Azure Pipelines not running for pull requests, gnunet, 2020/04/30
- [gnurl] 28/264: gskit: update the copyright year range, gnunet, 2020/04/30
- [gnurl] 31/264: tool_operate: fix add_parallel_transfers when more are in queue, gnunet, 2020/04/30
- [gnurl] 38/264: writeout_json: add missing comma to fix the HTTP version, gnunet, 2020/04/30
- [gnurl] 18/264: connect: happy eyeballs cleanup, gnunet, 2020/04/30
- [gnurl] 26/264: tests: fix verification of stdout in test 1452 due to newline, gnunet, 2020/04/30
- [gnurl] 35/264: CI: stop ignoring 323, it is disabled, gnunet, 2020/04/30