mirror of
https://github.com/curl/curl.git
synced 2026-07-23 23:27:21 +03:00
tool: fix memory use in parallel mode
The curl tool was creating a new transfer every time it checked if it needed to add one to reach max parallelism. This led to eventually all configured transfers to have easy handles created. Limit the creation again to the ones needed for max parallelism. scorecard.py: set --out-null only for curl versions that support it Closes #22277
This commit is contained in:
parent
b093d88447
commit
eb73af253c
3 changed files with 19 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue