curl: add variables to --write-out

In particular, these ones can help a user to create its own error
message when one or transfers fail.

writeout: add 'onerror', 'url', 'urlnum', 'exitcode', 'errormsg'

onerror - lets a user only show the rest on non-zero exit codes

url - the input URL used for this transfer

urlnum - the numerical URL counter (0 indexed) for this transfer

exitcode - the numerical exit code for the transfer

errormsg - obvious

Reported-by: Earnestly on github
Fixes #6199
Closes #6207
This commit is contained in:
Daniel Stenberg 2020-12-14 10:09:51 +01:00
parent ebdb5f23cc
commit 7a90ddf88f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 128 additions and 104 deletions

View file

@ -105,6 +105,7 @@ struct getout {
char *outfile; /* where to store the output */
char *infile; /* file to upload, if GETOUT_UPLOAD is set */
int flags; /* options - composed of GETOUT_* bits */
int num; /* which URL number in an invocation */
};
#define GETOUT_OUTFILE (1<<0) /* set when outfile is deemed done */