tool_operate: reduce errorbuffer allocs

- parallel transfers: only alloc and keep errorbuffers in memory for
  actual "live" transfers and not for the ones in the pending queue

- serial transfers: reuse the same fixed buffer for all transfers, not
  allocated at all.

Closes #9394
This commit is contained in:
Daniel Stenberg 2022-08-30 16:44:12 +02:00
parent c9061f242b
commit 7be53774c4
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 31 additions and 9 deletions

View file

@ -195,8 +195,8 @@ static int writeString(FILE *stream, const struct writeoutvar *wovar,
switch(wovar->id) {
case VAR_ERRORMSG:
if(per_result) {
strinfo = per->errorbuffer[0] ? per->errorbuffer :
curl_easy_strerror(per_result);
strinfo = (per->errorbuffer && per->errorbuffer[0]) ?
per->errorbuffer : curl_easy_strerror(per_result);
valid = true;
}
break;