mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
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
This commit is contained in:
parent
afcab2c2b6
commit
b4a39491ca
@ -523,6 +523,13 @@ after having run curl.
|
|||||||
(SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket
|
(SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket
|
||||||
is used to seed the random engine for SSL connections. See also the
|
is used to seed the random engine for SSL connections. See also the
|
||||||
\fI--random-file\fP option.
|
\fI--random-file\fP option.
|
||||||
|
.IP "--expect100-timeout <seconds>"
|
||||||
|
(HTTP) Maximum time in seconds that you allow curl to wait for a 100-continue
|
||||||
|
response when curl emits an Expects: 100-continue header in its request. By
|
||||||
|
default curl will wait one second. This option accepts decimal values! When
|
||||||
|
curl stops waiting, it will continue as if the response has been received.
|
||||||
|
|
||||||
|
(Added in 7.47.0)
|
||||||
.IP "--cert-type <type>"
|
.IP "--cert-type <type>"
|
||||||
(SSL) Tells curl what certificate type the provided certificate is in. PEM,
|
(SSL) Tells curl what certificate type the provided certificate is in. PEM,
|
||||||
DER and ENG are recognized types. If not specified, PEM is assumed.
|
DER and ENG are recognized types. If not specified, PEM is assumed.
|
||||||
|
@ -214,6 +214,7 @@ struct OperationConfig {
|
|||||||
char *unix_socket_path; /* path to Unix domain socket */
|
char *unix_socket_path; /* path to Unix domain socket */
|
||||||
bool falsestart;
|
bool falsestart;
|
||||||
bool path_as_is;
|
bool path_as_is;
|
||||||
|
double expect100timeout;
|
||||||
struct GlobalConfig *global;
|
struct GlobalConfig *global;
|
||||||
struct OperationConfig *prev;
|
struct OperationConfig *prev;
|
||||||
struct OperationConfig *next; /* Always last in the struct */
|
struct OperationConfig *next; /* Always last in the struct */
|
||||||
|
@ -179,6 +179,7 @@ static const struct LongShort aliases[]= {
|
|||||||
{"$O", "proxy-service-name", TRUE},
|
{"$O", "proxy-service-name", TRUE},
|
||||||
{"$P", "service-name", TRUE},
|
{"$P", "service-name", TRUE},
|
||||||
{"$Q", "proto-default", TRUE},
|
{"$Q", "proto-default", TRUE},
|
||||||
|
{"$R", "expect100-timeout", TRUE},
|
||||||
{"0", "http1.0", FALSE},
|
{"0", "http1.0", FALSE},
|
||||||
{"01", "http1.1", FALSE},
|
{"01", "http1.1", FALSE},
|
||||||
{"02", "http2", FALSE},
|
{"02", "http2", FALSE},
|
||||||
@ -999,6 +1000,11 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||||||
if(err)
|
if(err)
|
||||||
return err;
|
return err;
|
||||||
break;
|
break;
|
||||||
|
case 'R': /* --expect100-timeout */
|
||||||
|
err = str2udouble(&config->expect100timeout, nextarg);
|
||||||
|
if(err)
|
||||||
|
return err;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '#': /* --progress-bar */
|
case '#': /* --progress-bar */
|
||||||
|
@ -83,6 +83,7 @@ static const char *const helptext[] = {
|
|||||||
#ifdef USE_ENVIRONMENT
|
#ifdef USE_ENVIRONMENT
|
||||||
" --environment Write results to environment variables (RISC OS)",
|
" --environment Write results to environment variables (RISC OS)",
|
||||||
#endif
|
#endif
|
||||||
|
" --expect100-timeout SECONDS How long to wait for 100-continue (H)",
|
||||||
" -f, --fail Fail silently (no output at all) on HTTP errors (H)",
|
" -f, --fail Fail silently (no output at all) on HTTP errors (H)",
|
||||||
" --false-start Enable TLS False Start.",
|
" --false-start Enable TLS False Start.",
|
||||||
" -F, --form CONTENT Specify HTTP multipart POST data (H)",
|
" -F, --form CONTENT Specify HTTP multipart POST data (H)",
|
||||||
|
@ -1358,6 +1358,11 @@ static CURLcode operate_do(struct GlobalConfig *global,
|
|||||||
if(config->proto_default)
|
if(config->proto_default)
|
||||||
my_setopt_str(curl, CURLOPT_DEFAULT_PROTOCOL, 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 */
|
/* initialize retry vars for loop below */
|
||||||
retry_sleep_default = (config->retry_delay) ?
|
retry_sleep_default = (config->retry_delay) ?
|
||||||
config->retry_delay*1000L : RETRY_SLEEP_DEFAULT; /* ms */
|
config->retry_delay*1000L : RETRY_SLEEP_DEFAULT; /* ms */
|
||||||
|
Loading…
Reference in New Issue
Block a user