← Commit list

ca26e728a6

Daniel Stenberg
Daniel Stenberg
2026-08-13
SUCCESS Duration: 401s

Subject

conncache: don't assume curl_off_t increment wrap-around

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/conncache.c+1 -1
@@ -274,7 +274,7 @@ void Curl_cpool_xfer_init(struct Curl_easy *data)
CPOOL_LOCK(cpool, data);
/* the identifier inside the connection cache */
data->id = cpool->next_easy_id++;
- if(cpool->next_easy_id <= 0)
+ if(cpool->next_easy_id == CURL_OFF_T_MAX)
cpool->next_easy_id = 0;
data->state.lastconnect_id = -1;
lib/urldata.h+3 -3
@@ -1216,9 +1216,9 @@ struct Curl_easy {
/* once an easy handle is tied to a connection pool a non-negative number to
distinguish this transfer from other using the same pool. For easier
- tracking in log output. This may wrap around after LONG_MAX to 0 again,
- so it has no uniqueness guarantee for large processings. Note: it has no
- uniqueness either IFF more than one connection pool is used by the
+ tracking in log output. This may wrap around after CURL_OFF_T_MAX to 0
+ again, so it has no uniqueness guarantee for large processings. Note: it
+ has no uniqueness either IFF more than one connection pool is used by the
libcurl application. */
curl_off_t id;
uint32_t master_mid; /* if set, this transfer belongs to a master */