aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-12-14 13:29:13 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-12-15 13:59:56 +0100
commitb4a39491cacde68c9ed5499db7fcc873976e1879 (patch)
tree478444c9901e9f465803c57dfe106e201d1c7de9 /src
parentafcab2c2b602ee2ad45378505770c483d3b99207 (diff)
curl --expect100-timeout: added
This is the new command line option to set the value for the existing libcurl option CURLOPT_EXPECT_100_TIMEOUT_MS
Diffstat (limited to 'src')
-rw-r--r--src/tool_cfgable.h1
-rw-r--r--src/tool_getparam.c6
-rw-r--r--src/tool_help.c1
-rw-r--r--src/tool_operate.c5
4 files changed, 13 insertions, 0 deletions
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h
index 85b8bcfee..b92a273d1 100644
--- a/src/tool_cfgable.h
+++ b/src/tool_cfgable.h
@@ -214,6 +214,7 @@ struct OperationConfig {
char *unix_socket_path; /* path to Unix domain socket */
bool falsestart;
bool path_as_is;
+ double expect100timeout;
struct GlobalConfig *global;
struct OperationConfig *prev;
struct OperationConfig *next; /* Always last in the struct */
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index fd20cdc26..d123e231b 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -179,6 +179,7 @@ static const struct LongShort aliases[]= {
{"$O", "proxy-service-name", TRUE},
{"$P", "service-name", TRUE},
{"$Q", "proto-default", TRUE},
+ {"$R", "expect100-timeout", TRUE},
{"0", "http1.0", FALSE},
{"01", "http1.1", FALSE},
{"02", "http2", FALSE},
@@ -999,6 +1000,11 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
if(err)
return err;
break;
+ case 'R': /* --expect100-timeout */
+ err = str2udouble(&config->expect100timeout, nextarg);
+ if(err)
+ return err;
+ break;
}
break;
case '#': /* --progress-bar */
diff --git a/src/tool_help.c b/src/tool_help.c
index 4f569cde6..bbb2f66be 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -83,6 +83,7 @@ static const char *const helptext[] = {
#ifdef USE_ENVIRONMENT
" --environment Write results to environment variables (RISC OS)",
#endif
+ " --expect100-timeout SECONDS How long to wait for 100-continue (H)",
" -f, --fail Fail silently (no output at all) on HTTP errors (H)",
" --false-start Enable TLS False Start.",
" -F, --form CONTENT Specify HTTP multipart POST data (H)",
diff --git a/src/tool_operate.c b/src/tool_operate.c
index e5506c6fa..30d60cb33 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1358,6 +1358,11 @@ static CURLcode operate_do(struct GlobalConfig *global,
if(config->proto_default)
my_setopt_str(curl, CURLOPT_DEFAULT_PROTOCOL, config->proto_default);
+ /* new in 7.47.0 */
+ if(config->expect100timeout > 0)
+ my_setopt_str(curl, CURLOPT_EXPECT_100_TIMEOUT_MS,
+ (long)(config->expect100timeout*1000));
+
/* initialize retry vars for loop below */
retry_sleep_default = (config->retry_delay) ?
config->retry_delay*1000L : RETRY_SLEEP_DEFAULT; /* ms */