aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlessandro Ghedini <alessandro@cloudflare.com>2016-02-16 12:21:34 +0000
committerDaniel Stenberg <daniel@haxx.se>2016-04-18 23:17:19 +0200
commitd49087f6bc95d159eeb1172173fc1e95411041fa (patch)
tree029e38a3d9ad38ad033ab0e92abc01632be5cfdc /src
parent8f72b1366054c2466f45fd4ea6bf42d74a0400d2 (diff)
downloadgnurl-d49087f6bc95d159eeb1172173fc1e95411041fa.tar.gz
gnurl-d49087f6bc95d159eeb1172173fc1e95411041fa.tar.bz2
gnurl-d49087f6bc95d159eeb1172173fc1e95411041fa.zip
tool: add --tcp-fastopen option
Diffstat (limited to 'src')
-rw-r--r--src/tool_cfgable.h1
-rw-r--r--src/tool_getparam.c5
-rw-r--r--src/tool_help.c1
-rw-r--r--src/tool_operate.c3
4 files changed, 10 insertions, 0 deletions
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h
index e6f4e840d..aa98fced5 100644
--- a/src/tool_cfgable.h
+++ b/src/tool_cfgable.h
@@ -174,6 +174,7 @@ struct OperationConfig {
Kerberos 5 and SPNEGO */
bool tcp_nodelay;
+ bool tcp_fastopen;
long req_retry; /* number of retries */
long retry_delay; /* delay between retries (in seconds) */
long retry_maxtime; /* maximum time to keep retrying */
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 3dea7a775..b14cc4b27 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -229,6 +229,7 @@ static const struct LongShort aliases[]= {
{"Eq", "cert-status", FALSE},
{"Er", "false-start", FALSE},
{"Es", "ssl-no-revoke", FALSE},
+ {"Et", "tcp-fastopen", FALSE},
{"f", "fail", FALSE},
{"F", "form", TRUE},
{"Fs", "form-string", TRUE},
@@ -1415,6 +1416,10 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
config->ssl_no_revoke = TRUE;
break;
+ case 't': /* --tcp-fastopen */
+ config->tcp_fastopen = TRUE;
+ break;
+
default: /* certificate file */
{
char *certname, *passphrase;
diff --git a/src/tool_help.c b/src/tool_help.c
index 8b4551ba2..bb60ba0e3 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -221,6 +221,7 @@ static const char *const helptext[] = {
" --ssl-no-revoke Disable cert revocation checks (WinSSL)",
" --stderr FILE Where to redirect stderr (use \"-\" for stdout)",
" --tcp-nodelay Use the TCP_NODELAY option",
+ " --tcp-fastopen Use TCP Fast Open",
" -t, --telnet-option OPT=VAL Set telnet option",
" --tftp-blksize VALUE Set TFTP BLKSIZE option (must be >512)",
" --tftp-no-options Do not send TFTP options requests",
diff --git a/src/tool_operate.c b/src/tool_operate.c
index deabf90b3..ebd485c20 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -794,6 +794,9 @@ static CURLcode operate_do(struct GlobalConfig *global,
if(config->tcp_nodelay)
my_setopt(curl, CURLOPT_TCP_NODELAY, 1L);
+ if(config->tcp_fastopen)
+ my_setopt(curl, CURLOPT_TCP_FASTOPEN, 1L);
+
/* where to store */
my_setopt(curl, CURLOPT_WRITEDATA, &outs);
if(metalink || !config->use_metalink)