]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: httpclient: enable l7-retry
authorWilliam Lallemand <wlallemand@haproxy.org>
Thu, 17 Mar 2022 14:24:28 +0000 (15:24 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 6 Apr 2022 09:50:10 +0000 (11:50 +0200)
Enable the layer-7 retry in the httpclient. This way the client will
retry upon a connection error or a timeout.

src/http_client.c

index c1a5ec551df82f6bc1c60cf6d6933b2589d010ce..f06be65941d030eb21403a4315507310ce74ae90 100644 (file)
@@ -999,10 +999,12 @@ static int httpclient_init()
        proxy_preset_defaults(httpclient_proxy);
 
        httpclient_proxy->options |= PR_O_WREQ_BODY;
+       httpclient_proxy->retry_type |= PR_RE_CONN_FAILED | PR_RE_DISCONNECTED | PR_RE_TIMEOUT;
        httpclient_proxy->options2 |= PR_O2_INDEPSTR;
        httpclient_proxy->mode = PR_MODE_HTTP;
        httpclient_proxy->maxconn = 0;
        httpclient_proxy->accept = NULL;
+       httpclient_proxy->conn_retries = CONN_RETRIES;
        httpclient_proxy->timeout.client = TICK_ETERNITY;
        /* The HTTP Client use the "option httplog" with the global log server */
        httpclient_proxy->conf.logformat_string = default_http_log_format;