]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUILD] fix build for systems without SOL_TCP
authorWilly Tarreau <w@1wt.eu>
Sun, 16 Aug 2009 12:13:47 +0000 (14:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 16 Aug 2009 12:13:47 +0000 (14:13 +0200)
Andrew Azarov reported that haproxy-1.4-dev1 does not build
under FreeBSD 7.2 because SOL_TCP is not defined. So add a
check for its definition before using it. This only impacts
network optimisations anyway.

src/backend.c
src/checks.c
src/proto_tcp.c
src/stream_sock.c

index a67d6484625041b907e94cfb1de2cc10e19d274b..baa301a552a1f596e15bc3cbba4022794ace2e59 100644 (file)
@@ -1968,7 +1968,7 @@ int connect_server(struct session *s)
                }
        }
 
-#ifdef TCP_QUICKACK
+#if defined(TCP_QUICKACK) && defined(SOL_TCP)
        /* disabling tcp quick ack now allows the first request to leave the
         * machine with the first ACK. We only do this if there are pending
         * data in the buffer.
index 40fb698ef9fb786ee194b995fb18d61660490301..211a2ec59a53c34f1667a8f866abc0ef9ade3a4c 100644 (file)
@@ -678,7 +678,7 @@ struct task *process_chk(struct task *t)
                                }
 
                                if (s->result == SRV_CHK_UNKNOWN) {
-#ifdef TCP_QUICKACK
+#if defined(TCP_QUICKACK) && defined(SOL_TCP)
                                        /* disabling tcp quick ack now allows
                                         * the request to leave the machine with
                                         * the first ACK.
index 99900e452c8bf6c1f521ba220b0caa0fc5293b38..0091464dccc6257b242879f17c0abb095058e10f 100644 (file)
@@ -251,7 +251,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
                }
        }
 #endif
-#ifdef TCP_MAXSEG
+#if defined(TCP_MAXSEG) && defined(SOL_TCP)
        if (listener->maxseg) {
                if (setsockopt(fd, SOL_TCP, TCP_MAXSEG,
                               &listener->maxseg, sizeof(listener->maxseg)) == -1) {
@@ -272,7 +272,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
                goto tcp_close_return;
        }
 
-#ifdef TCP_QUICKACK
+#if defined(TCP_QUICKACK) && defined(SOL_TCP)
        if (listener->options & LI_O_NOQUICKACK)
                setsockopt(fd, SOL_TCP, TCP_QUICKACK, (char *) &zero, sizeof(zero));
 #endif
index 00cb9e8be0c568ddb4d3842ad2e40cd128524a95..f20bb3f0cd9b897a492bb4cde77dcde2221dbd41 100644 (file)
@@ -587,7 +587,7 @@ static int stream_sock_write_loop(struct stream_interface *si, struct buffer *b)
                        max = b->send_max;
 
 
-#ifdef TCP_CORK
+#if defined(TCP_CORK) && defined(SOL_TCP)
                /*
                 * Check if we want to cork output before sending. This typically occurs
                 * when there are data left in the buffer, or when we reached the end of
@@ -670,7 +670,7 @@ static int stream_sock_write_loop(struct stream_interface *si, struct buffer *b)
         */
        if (unlikely((fdtab[si->fd].flags & (FD_FL_TCP|FD_FL_TCP_NODELAY)) == FD_FL_TCP && (b->flags & BF_EMPTY))) {
                if ((b->flags & (BF_SHUTW|BF_SHUTW_NOW|BF_HIJACK|BF_WRITE_ENA|BF_SHUTR)) != (BF_WRITE_ENA|BF_SHUTR)) {
-#ifdef TCP_CORK
+#if defined(TCP_CORK) && defined(SOL_TCP)
                        if (fdtab[si->fd].flags & FD_FL_TCP_CORK)
                                setsockopt(si->fd, SOL_TCP, TCP_CORK, (char *) &zero, sizeof(zero));
 #endif