From: Willy Tarreau Date: Wed, 15 Jul 2009 05:16:31 +0000 (+0200) Subject: [MINOR] apply tcp-smart-connect option for the checks too X-Git-Tag: v1.4-dev1~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1274bc4fa8637380a82159c44dd9f3f0b42e8e32;p=thirdparty%2Fhaproxy.git [MINOR] apply tcp-smart-connect option for the checks too We should respect tcp-smart-connect for checks too. First it reduces the traffic, and second it ensures that the checks see the same thing as the production traffic, which is better for debugging. --- diff --git a/src/checks.c b/src/checks.c index 4022cad581..40fb698ef9 100644 --- a/src/checks.c +++ b/src/checks.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -677,6 +678,14 @@ struct task *process_chk(struct task *t) } if (s->result == SRV_CHK_UNKNOWN) { +#ifdef TCP_QUICKACK + /* disabling tcp quick ack now allows + * the request to leave the machine with + * the first ACK. + */ + if (s->proxy->options2 & PR_O2_SMARTCON) + setsockopt(fd, SOL_TCP, TCP_QUICKACK, (char *) &zero, sizeof(zero)); +#endif if ((connect(fd, (struct sockaddr *)&sa, sizeof(sa)) != -1) || (errno == EINPROGRESS)) { /* OK, connection in progress or established */