]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: Add "handshake" new timeout (frontend side)
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 14 Nov 2023 17:31:38 +0000 (18:31 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Fri, 17 Nov 2023 16:31:42 +0000 (17:31 +0100)
Add a new timeout for the handshake, on the frontend side only. Such a hanshake
will be typically used for TLS hanshakes during client connections to TLS/TCP or
QUIC frontends.

include/haproxy/proxy-t.h
src/proxy.c

index e8cb7a5eefe0971c459bc4306db21e2741323477..e07ebf03dfae1c93933d2e2311471733cf7861e6 100644 (file)
@@ -338,6 +338,7 @@ struct proxy {
                int queue;                      /* queue timeout, defaults to connect if unspecified */
                int connect;                    /* connect timeout (in ticks) */
                int server;                     /* server I/O timeout (in ticks) */
+               int handshake;                  /* maximum time for handshake completion */
                int httpreq;                    /* maximum time for complete HTTP request */
                int httpka;                     /* maximum time for a new HTTP request when using keep-alive */
                int check;                      /* maximum time for complete check */
index f1b81f6f8a58f22f2343b937e47d8b5b17c7c9fb..51823b378189de48192fe769d8ddf88035a49a3c 100644 (file)
@@ -524,6 +524,10 @@ static int proxy_parse_timeout(char **args, int section, struct proxy *proxy,
                tv = &proxy->timeout.tarpit;
                td = &defpx->timeout.tarpit;
                cap = PR_CAP_FE | PR_CAP_BE;
+       } else if (strcmp(args[0], "handshake") == 0) {
+               tv = &proxy->timeout.handshake;
+               td = &defpx->timeout.handshake;
+               cap = PR_CAP_FE;
        } else if (strcmp(args[0], "http-keep-alive") == 0) {
                tv = &proxy->timeout.httpka;
                td = &defpx->timeout.httpka;
@@ -574,7 +578,7 @@ static int proxy_parse_timeout(char **args, int section, struct proxy *proxy,
        } else {
                memprintf(err,
                          "'timeout' supports 'client', 'server', 'connect', 'check', "
-                         "'queue', 'http-keep-alive', 'http-request', 'tunnel', 'tarpit', "
+                         "'queue', 'handshake', 'http-keep-alive', 'http-request', 'tunnel', 'tarpit', "
                          "'client-fin' and 'server-fin' (got '%s')",
                          args[0]);
                return -1;
@@ -1797,6 +1801,7 @@ static int proxy_defproxy_cpy(struct proxy *curproxy, const struct proxy *defpro
 
        if (curproxy->cap & PR_CAP_FE) {
                curproxy->timeout.client = defproxy->timeout.client;
+               curproxy->timeout.handshake = defproxy->timeout.handshake;
                curproxy->timeout.clientfin = defproxy->timeout.clientfin;
                curproxy->timeout.tarpit = defproxy->timeout.tarpit;
                curproxy->timeout.httpreq = defproxy->timeout.httpreq;