Daniel Rankov reported that "option nolinger" is inefficient on backends.
The reason is that it is set on the file descriptor only, which does not
prevent haproxy from performing a clean shutdown() before closing. We must
set the flag on the stream_interface instead if we want an RST to be emitted
upon active close.
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &one, sizeof(one));
if (be->options & PR_O_TCP_NOLING)
- setsockopt(fd, SOL_SOCKET, SO_LINGER, &nolinger, sizeof(struct linger));
+ si->flags |= SI_FL_NOLINGER;
/* allow specific binding :
* - server-specific at first