From: Willy Tarreau Date: Thu, 18 Oct 2007 16:07:48 +0000 (+0200) Subject: [MINOR] use nolinger on health-checks if backend is set to nolinger X-Git-Tag: v1.3.13~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9edd161554b3f4603437e069d958c1610522b6fe;p=thirdparty%2Fhaproxy.git [MINOR] use nolinger on health-checks if backend is set to nolinger If the administrator finds it useful to disable lingering on the backend, let's disable lingering on health-checks too. --- diff --git a/src/checks.c b/src/checks.c index 490ff02f26..0cd1a87417 100644 --- a/src/checks.c +++ b/src/checks.c @@ -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 */