]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] use nolinger on health-checks if backend is set to nolinger
authorWilly Tarreau <w@1wt.eu>
Thu, 18 Oct 2007 16:07:48 +0000 (18:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 18 Oct 2007 16:07:48 +0000 (18:07 +0200)
If the administrator finds it useful to disable lingering on the backend,
let's disable lingering on health-checks too.

src/checks.c

index 490ff02f26021402b66f99eaa0b558d2f041fe7f..0cd1a874179886a9d127acfa1e8e9521e2c7a4c0 100644 (file)
@@ -316,6 +316,10 @@ void process_chk(struct task *t, struct timeval *next)
                            (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *) &one, sizeof(one)) != -1)) {
                                //fprintf(stderr, "process_chk: 3\n");
 
+                               if (s->proxy->options & PR_O_TCP_NOLING) {
+                                       /* We don't want to useless data */
+                                       setsockopt(fd, SOL_SOCKET, SO_LINGER, (struct linger *) &nolinger, sizeof(struct linger));
+                               }
                                
                                if (s->check_addr.sin_addr.s_addr)
                                        /* we'll connect to the check addr specified on the server */