From: Willy Tarreau Date: Tue, 14 Mar 2017 13:36:26 +0000 (+0100) Subject: CONTRIB: tcploop: make it build on FreeBSD X-Git-Tag: v1.8-dev1~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c0c0a6c26c31355f0913a971077c7d764a01b7a;p=thirdparty%2Fhaproxy.git CONTRIB: tcploop: make it build on FreeBSD A few changes : - SOL_TCP must be replaced with IPPROTO_TCP - TCP_NOQUICKACK is not defined - MSG_MORE can be ignored and replaced with 0 --- diff --git a/contrib/tcploop/tcploop.c b/contrib/tcploop/tcploop.c index 033481150f..2b1735b638 100644 --- a/contrib/tcploop/tcploop.c +++ b/contrib/tcploop/tcploop.c @@ -50,6 +50,13 @@ #include #include +#ifndef SOL_TCP +#define SOL_TCP IPPROTO_TCP +#endif + +#ifndef MSG_MORE +#define MSG_MORE 0 +#endif struct err_msg { int size; @@ -309,8 +316,12 @@ int tcp_set_nolinger(int sock, const char *arg) int tcp_set_noquickack(int sock, const char *arg) { +#ifdef TCP_QUICKACK /* warning: do not use during connect if nothing is to be sent! */ return setsockopt(sock, SOL_TCP, TCP_QUICKACK, &zero, sizeof(zero)); +#else + return 0; +#endif } /* Try to listen to address . Return the fd or -1 in case of error */