From: William Lallemand Date: Sun, 14 Jun 2026 08:46:38 +0000 (+0200) Subject: MEDIUM: httpclient: set res.status to 0 upon SF_ERR_MASK X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f371bfd608b39d2e3c25ca941dd621a4ee3166f1;p=thirdparty%2Fhaproxy.git MEDIUM: httpclient: set res.status to 0 upon SF_ERR_MASK With the httpclient it's difficult to get if the HTTP status code was returned by the actual server or if it's the internal proxy that generate the error. This patch changes the behavior by setting the status to 0 when an error is get by the stream. There were already valid cases when the status was 0 on some error, so that should not really change the error path in the scripts. --- diff --git a/src/http_client.c b/src/http_client.c index c1937c471..fa205f0f0 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -688,6 +688,10 @@ void httpclient_applet_io_handler(struct appctx *appctx) /* copy the status line in the httpclient */ hc->res.status = sl->info.res.status; + + if (__sc_strm(appctx_sc(appctx))->flags & SF_ERR_MASK) + hc->res.status = 0; + hc->res.vsn = istdup(htx_sl_res_vsn(sl)); hc->res.reason = istdup(htx_sl_res_reason(sl)); htx_remove_blk(htx, blk);