From 979b012eeb1908e7e3ad13c736fb1dbc73187780 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Sun, 5 Nov 2017 23:59:55 +0000 Subject: 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 --- lib/setopt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/setopt.c') 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 #endif +#ifdef HAVE_LINUX_TCP_H +#include +#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; -- cgit v1.2.3