mirror of
https://github.com/curl/curl.git
synced 2026-07-29 03:03:08 +03:00
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:
parent
065a653158
commit
da27db068f
5 changed files with 204 additions and 252 deletions
|
|
@ -52,6 +52,7 @@ struct OperationConfig *config_alloc(void)
|
|||
config->ftp_skip_ip = TRUE;
|
||||
config->file_clobber_mode = CLOBBER_DEFAULT;
|
||||
config->upload_flags = CURLULFLAG_SEEN;
|
||||
config->retry_delay_ms = RETRY_SLEEP_DEFAULT;
|
||||
curlx_dyn_init(&config->postdata, MAX_FILE2MEMORY);
|
||||
return config;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue