BUG/MEDIUM: checks/mux: always enable send-polling after connecting

Before introducing the mux layer, tcp_connect() would poll for sending
to detect the connection establishment. It happens that the health
checks have apparently never explicitly enabled this polling and have
been relying on this implicit one.

Now that there's the mux layer, the conn_stream needs to be enabled
for polling as well and since it's not done in the checks, it's never
done and the check's request doesn't leave the machine, as can be
noticed with http checks.

The solution simply consists in going back to the well-known case
where we enable polling after connecting using cs_want_send() if we
have anything but just a plain connect(). The regular data path is
not affected because the stream interface code automatically computes
the polling needs based on buffer contents.
This commit is contained in:
Willy Tarreau 2017-11-02 15:45:00 +01:00
parent f13ef96e70
commit 16257f648f

View File

@ -1586,6 +1586,10 @@ static int connect_conn_chk(struct task *t)
ret = SF_ERR_INTERNAL;
if (proto && proto->connect)
ret = proto->connect(conn, check->type, quickack ? 2 : 0);
if (check->type)
cs_want_send(cs);
#ifdef USE_OPENSSL
if (s->check.sni)
ssl_sock_set_servername(conn, s->check.sni);