From 1274bc4fa8637380a82159c44dd9f3f0b42e8e32 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 15 Jul 2009 07:16:31 +0200 Subject: [PATCH] [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. --- src/checks.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/checks.c b/src/checks.c index 4022cad58..40fb698ef 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 */