aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorAlessandro Ghedini <alessandro@cloudflare.com>2016-02-16 12:21:03 +0000
committerDaniel Stenberg <daniel@haxx.se>2016-04-18 23:17:19 +0200
commitdc68f2dab952a4a61d61e175d246ac2e55d75d5b (patch)
tree79ceb76399d4710ce87698217a83f057583732f1 /lib/url.c
parenta542536cf6e8f2eab0788486a60f810a58cb3b3e (diff)
url: add CURLOPT_TCP_FASTOPEN option
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index c93491582..e76d4e8e0 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -595,6 +595,7 @@ CURLcode Curl_init_userdefined(struct UserDefined *set)
set->tcp_keepalive = FALSE;
set->tcp_keepintvl = 60;
set->tcp_keepidle = 60;
+ set->tcp_fastopen = FALSE;
set->ssl_enable_npn = TRUE;
set->ssl_enable_alpn = TRUE;
@@ -2631,6 +2632,13 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
case CURLOPT_TCP_KEEPINTVL:
data->set.tcp_keepintvl = va_arg(param, long);
break;
+ case CURLOPT_TCP_FASTOPEN:
+#if defined(CONNECT_DATA_IDEMPOTENT)
+ data->set.tcp_fastopen = (0 != va_arg(param, long))?TRUE:FALSE;
+#else
+ result = CURLE_NOT_BUILT_IN;
+#endif
+ break;
case CURLOPT_SSL_ENABLE_NPN:
data->set.ssl_enable_npn = (0 != va_arg(param, long)) ? TRUE : FALSE;
break;
@@ -5975,6 +5983,8 @@ static CURLcode create_conn(struct SessionHandle *data,
conn->recv[SECONDARYSOCKET] = Curl_recv_plain;
conn->send[SECONDARYSOCKET] = Curl_send_plain;
+ conn->bits.tcp_fastopen = data->set.tcp_fastopen;
+
/***********************************************************************
* file: is a special case in that it doesn't need a network connection
***********************************************************************/