← Commit list

5e46318414

Emre Çalışkan
Emre Çalışkan
2025-10-15
SUCCESS Duration: 166s

Subject

transfer: reset retry count on each request

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/easy.c+0 -1
@@ -1119,7 +1119,6 @@ void curl_easy_reset(CURL *d)
data->progress.hide = TRUE;
data->state.current_speed = -1; /* init to negative == impossible */
- data->state.retrycount = 0; /* reset the retry counter */
data->state.recent_conn_id = -1; /* clear remembered connection id */
/* zero out authentication data: */
lib/transfer.c+8 -0
@@ -481,6 +481,14 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
{
CURLcode result = CURLE_OK;
+ /* Reset the retry count at the start of each request.
+ * If the retry count is not reset, when the connection drops,
+ * it will not enter the retry mechanism on CONN_MAX_RETRIES + 1 attempts
+ * and will immediately throw
+ * "Connection died, tried CONN_MAX_RETRIES times before giving up".
+ * By resetting it here, we ensure each new request starts fresh. */
+ data->state.retrycount = 0;
+
if(!data->set.str[STRING_SET_URL] && !data->set.uh) {
/* we cannot do anything without URL */
failf(data, "No URL set");