MEDIUM: session: handshake timeout (TCP)

Adapt session_accept_fd() called on accept() to set the handshake timeout from
"hanshake-timeout" setting if set by configuration. If not set, continue to use
the "client" timeout setting.
This commit is contained in:
Frédéric Lécaille 2023-11-15 14:24:10 +01:00
parent 392640a61b
commit 373e40f0c1

View file

@ -279,13 +279,19 @@ int session_accept_fd(struct connection *cli_conn)
* conn -- owner ---> task <-----+
*/
if (cli_conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS)) {
int timeout;
int clt_tmt = p->timeout.client;
int hs_tmt = p->timeout.handshake;
if (unlikely((sess->task = task_new_here()) == NULL))
goto out_free_sess;
/* Handshake timeout as default timeout */
timeout = hs_tmt ? hs_tmt : clt_tmt;
sess->task->context = sess;
sess->task->nice = l->bind_conf->nice;
sess->task->process = session_expire_embryonic;
sess->task->expire = tick_add_ifset(now_ms, p->timeout.client);
sess->task->expire = tick_add_ifset(now_ms, timeout);
task_queue(sess->task);
return 1;
}