mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-25 06:53:03 +00:00
MINOR: checks: don't create then kill a dummy connection before tcp-checks
When tcp-checks are in use, a connection starts to be created, then it's destroyed so that tcp-check can recreate its own. Now we directly move to tcpcheck_main() when it's detected that tcp-check is in use.
This commit is contained in:
parent
be74b88be8
commit
f411cce456
28
src/checks.c
28
src/checks.c
@ -1483,12 +1483,15 @@ static int connect_conn_chk(struct task *t)
|
||||
struct server *s = check->server;
|
||||
struct connection *conn = check->conn;
|
||||
struct protocol *proto;
|
||||
struct tcpcheck_rule *tcp_rule = NULL;
|
||||
int ret;
|
||||
int quickack;
|
||||
|
||||
/* tcpcheck send/expect initialisation */
|
||||
if (check->type == PR_O2_TCPCHK_CHK)
|
||||
if (check->type == PR_O2_TCPCHK_CHK) {
|
||||
check->current_step = NULL;
|
||||
tcp_rule = get_first_tcpcheck_rule(check->tcpcheck_rules);
|
||||
}
|
||||
|
||||
/* prepare the check buffer.
|
||||
* This should not be used if check is the secondary agent check
|
||||
@ -1522,6 +1525,14 @@ static int connect_conn_chk(struct task *t)
|
||||
bo_putblk(check->bo, check->send_string, check->send_string_len);
|
||||
}
|
||||
|
||||
/* for tcp-checks, the initial connection setup is handled separately as
|
||||
* it may be sent to a specific port and not to the server's.
|
||||
*/
|
||||
if (tcp_rule && tcp_rule->action == TCPCHK_ACT_CONNECT) {
|
||||
tcpcheck_main(check);
|
||||
return SF_ERR_UP;
|
||||
}
|
||||
|
||||
/* prepare a new connection */
|
||||
conn_init(conn);
|
||||
|
||||
@ -1558,19 +1569,8 @@ static int connect_conn_chk(struct task *t)
|
||||
/* only plain tcp-check supports quick ACK */
|
||||
quickack = check->type == 0 || check->type == PR_O2_TCPCHK_CHK;
|
||||
|
||||
if (check->type == PR_O2_TCPCHK_CHK) {
|
||||
struct tcpcheck_rule *r = get_first_tcpcheck_rule(check->tcpcheck_rules);
|
||||
|
||||
if (r) {
|
||||
/* if first step is a 'connect', then tcpcheck_main must run it */
|
||||
if (r->action == TCPCHK_ACT_CONNECT) {
|
||||
tcpcheck_main(check);
|
||||
return SF_ERR_UP;
|
||||
}
|
||||
if (r->action == TCPCHK_ACT_EXPECT)
|
||||
quickack = 0;
|
||||
}
|
||||
}
|
||||
if (tcp_rule && tcp_rule->action == TCPCHK_ACT_EXPECT)
|
||||
quickack = 0;
|
||||
|
||||
ret = SF_ERR_INTERNAL;
|
||||
if (proto && proto->connect)
|
||||
|
Loading…
Reference in New Issue
Block a user