[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.
This commit is contained in:
Willy Tarreau 2009-07-15 07:16:31 +02:00
parent 814c978fb6
commit 1274bc4fa8

View File

@ -21,6 +21,7 @@
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <common/compat.h>
@ -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 */