BUG/MEDIUM: connections: Add the CO_FL_CONNECTED flag if a send succeeded.

If a send succeeded, add the CO_FL_CONNECTED flag, the send may have been
called by the upper layers before we even realized we were connected, and we
may even read the response before we get the information, and si_cs_recv()
has to know if we were connected or not.

This should be backported to 1.9.
This commit is contained in:
Olivier Houchard 2019-01-17 19:09:11 +01:00 committed by Willy Tarreau
parent 09a0f03994
commit f24502ba46
2 changed files with 4 additions and 0 deletions

View File

@ -396,6 +396,8 @@ static size_t raw_sock_from_buf(struct connection *conn, const struct buffer *bu
count -= ret;
done += ret;
/* A send succeeded, so we can consier ourself connected */
conn->flags |= CO_FL_CONNECTED;
/* if the system buffer is full, don't insist */
if (ret < try)
break;

View File

@ -5723,6 +5723,8 @@ static size_t ssl_sock_from_buf(struct connection *conn, const struct buffer *bu
goto out_error;
}
if (ret > 0) {
/* A send succeeded, so we can consier ourself connected */
conn->flags |= CO_FL_CONNECTED;
conn->xprt_st &= ~SSL_SOCK_SEND_UNLIMITED;
count -= ret;
done += ret;