aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c10
-rw-r--r--lib/urldata.h3
2 files changed, 13 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
***********************************************************************/
diff --git a/lib/urldata.h b/lib/urldata.h
index aea688ced..016761929 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -544,6 +544,8 @@ struct ConnectBits {
connection */
bool type_set; /* type= was used in the URL */
bool multiplex; /* connection is multiplexed */
+
+ bool tcp_fastopen; /* use TCP Fast Open */
};
struct hostname {
@@ -1650,6 +1652,7 @@ struct UserDefined {
bool tcp_keepalive; /* use TCP keepalives */
long tcp_keepidle; /* seconds in idle before sending keepalive probe */
long tcp_keepintvl; /* seconds between TCP keepalive probes */
+ bool tcp_fastopen; /* use TCP Fast Open */
size_t maxconnects; /* Max idle connections in the connection cache */