tool_operate: cleanups

- move the state struct from config to global. It is used as a single
  instance anyway so might as well be a single one to save memory.
- simplify and combine several conditions
- set default retry delay inititally
- use better struct field names to make it easier to understand their
  purposes
- remove the state->outfiles field as it was not necessary
- remove superfluous glob cleanup call
- move conditions around to remove an indent level
- move the ->url NULL check

Takes single_transfer()'s complexity score down from 78 to 68.

Closes #18226
This commit is contained in:
Daniel Stenberg 2025-08-07 23:11:10 +02:00
parent 065a653158
commit da27db068f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 204 additions and 252 deletions

View file

@ -80,7 +80,7 @@ struct per_transfer {
};
CURLcode operate(int argc, argv_item_t argv[]);
void single_transfer_cleanup(struct OperationConfig *config);
void single_transfer_cleanup(void);
extern struct per_transfer *transfers; /* first node */