← Commit list

eb73af253c

Stefan Eissing
Stefan Eissing
2026-07-12
SUCCESS Duration: 194s

Subject

tool: fix memory use in parallel mode

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 →

src/tool_operate.c+8 -1
@@ -1552,7 +1552,13 @@ static CURLcode add_parallel_transfers(CURLM *multi, CURLSH *share,
return CURLE_UNKNOWN_OPTION;
}
- if(nxfers < (curl_off_t)(global->parallel_max * 2)) {
+ if(all_added >= global->parallel_max) {
+ /* we are at max parallelism, no need to create more transfers */
+ *morep = TRUE; /* pretend there are, we have not checked */
+ return CURLE_OK;
+ }
+ /* if the list is empty, create one to kickstart the loop */
+ if(!transfers) {
bool skipped = FALSE;
do {
result = create_transfer(share, addedp, &skipped);
@@ -1560,6 +1566,7 @@ static CURLcode add_parallel_transfers(CURLM *multi, CURLSH *share,
return result;
} while(skipped);
}
+ /* add transfers until max parallelism is achieved again */
for(per = transfers; per && (all_added < global->parallel_max);
per = per->next) {
if(per->added || per->skip)
tests/http/testenv/curl.py+4 -1
@@ -729,7 +729,10 @@ class CurlClient:
if extra_args is None:
extra_args = []
if no_save:
- extra_args.extend(['--out-null'])
+ if self.env.curl_version_at_least('8.16.0'):
+ extra_args.extend(['--out-null'])
+ else:
+ extra_args.extend(['-o', '/dev/null'])
else:
extra_args.extend(['-o', 'download_#1.data'])
if limit_rate:
tests/http/testenv/env.py+7 -0
@@ -512,6 +512,13 @@ class Env:
def curl_version_string() -> str:
return Env.CONFIG.curl_props["version_string"]
+ @staticmethod
+ def curl_version_at_least(min_version) -> bool:
+ version = Env.curl_version()
+ return Env.CONFIG.versiontuple(min_version) <= Env.CONFIG.versiontuple(
+ version
+ )
+
@staticmethod
def curl_features_string() -> str:
return Env.CONFIG.curl_props["features_string"]