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);
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)
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:
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"]