diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2017-11-05 23:59:55 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-11-24 10:49:59 +0100 |
commit | 979b012eeb1908e7e3ad13c736fb1dbc73187780 (patch) | |
tree | 2394f1bc436fbb337a666abc2daa5d5033a0d382 /lib/setopt.c | |
parent | 9f691be3d49840690f7d3a22e81e6fd3e03f0900 (diff) | |
download | curl-979b012eeb1908e7e3ad13c736fb1dbc73187780.tar.gz |
connect: add support for new TCP Fast Open API on Linux
The new API added in Linux 4.11 only requires setting a socket option
before connecting, without the whole sento() machinery.
Notably, this makes it possible to use TFO with SSL connections on Linux
as well, without the need to mess around with OpenSSL (or whatever other
SSL library) internals.
Closes #2056
Diffstat (limited to 'lib/setopt.c')
-rw-r--r-- | lib/setopt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/setopt.c b/lib/setopt.c index 200bfc5ab..70466bffb 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -26,6 +26,10 @@ #include <limits.h> #endif +#ifdef HAVE_LINUX_TCP_H +#include <linux/tcp.h> +#endif + #include "urldata.h" #include "url.h" #include "progress.h" @@ -2450,7 +2454,8 @@ static CURLcode setopt(struct Curl_easy *data, CURLoption option, data->set.tcp_keepintvl = arg; break; case CURLOPT_TCP_FASTOPEN: -#if defined(CONNECT_DATA_IDEMPOTENT) || defined(MSG_FASTOPEN) +#if defined(CONNECT_DATA_IDEMPOTENT) || defined(MSG_FASTOPEN) || \ + defined(TCP_FASTOPEN_CONNECT) data->set.tcp_fastopen = (0 != va_arg(param, long))?TRUE:FALSE; #else result = CURLE_NOT_BUILT_IN; |