From 5033d9a8b505e527c81cefb4dbcadf48159fdc96 Mon Sep 17 00:00:00 2001 From: Felix von Leitner Date: Thu, 7 Apr 2016 12:08:05 +0000 Subject: [PATCH] attempt to support FreeBSD --- socket/socket_fastopen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/socket/socket_fastopen.c b/socket/socket_fastopen.c index 0a9c659..dc1a5f9 100644 --- a/socket/socket_fastopen.c +++ b/socket/socket_fastopen.c @@ -2,10 +2,15 @@ #ifndef __MINGW32__ #include #include +#include #include #endif #include +#if defined(TCP_FASTOPEN) && !defined(SOL_TCP) && defined(IPPROTO_TCP) +#define SOL_TCP IPPROTO_TCP +#endif + int socket_fastopen(int s) { #if defined(SOL_TCP) && defined(TCP_FASTOPEN) return setsockopt(s,SOL_TCP,TCP_FASTOPEN,(int[]){ 5 }, sizeof(int));