mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-23 07:08:06 -04:00
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:
parent
392640a61b
commit
373e40f0c1
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue