curl: make --libcurl show binary posts correctly

Reported-by: Stephan Mühlstrasser
Fixes #6031
Closes #6032
This commit is contained in:
Daniel Stenberg 2020-10-01 22:59:30 +02:00
parent 9a13f7c2a7
commit 3997b3e2a4
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 41 additions and 24 deletions

View file

@ -98,14 +98,15 @@ CURLcode tool_setopt_mimepost(CURL *curl, struct GlobalConfig *config,
CURLcode tool_setopt_slist(CURL *curl, struct GlobalConfig *config,
const char *name, CURLoption tag,
struct curl_slist *list);
CURLcode tool_setopt(CURL *curl, bool str, struct GlobalConfig *config,
CURLcode tool_setopt(CURL *curl, bool str, struct GlobalConfig *global,
struct OperationConfig *config,
const char *name, CURLoption tag, ...);
#define my_setopt(x,y,z) \
SETOPT_CHECK(tool_setopt(x, FALSE, global, #y, y, z), y)
SETOPT_CHECK(tool_setopt(x, FALSE, global, config, #y, y, z), y)
#define my_setopt_str(x,y,z) \
SETOPT_CHECK(tool_setopt(x, TRUE, global, #y, y, z), y)
SETOPT_CHECK(tool_setopt(x, TRUE, global, config, #y, y, z), y)
#define my_setopt_enum(x,y,z) \
SETOPT_CHECK(tool_setopt_enum(x, global, #y, y, setopt_nv_ ## y, z), y)
@ -122,9 +123,9 @@ CURLcode tool_setopt(CURL *curl, bool str, struct GlobalConfig *config,
#define my_setopt_slist(x,y,z) \
SETOPT_CHECK(tool_setopt_slist(x, global, #y, y, z), y)
#define res_setopt(x,y,z) tool_setopt(x, FALSE, global, #y, y, z)
#define res_setopt(x,y,z) tool_setopt(x, FALSE, global, config, #y, y, z)
#define res_setopt_str(x,y,z) tool_setopt(x, TRUE, global, #y, y, z)
#define res_setopt_str(x,y,z) tool_setopt(x, TRUE, global, config, #y, y, z)
#else /* CURL_DISABLE_LIBCURL_OPTION */