From: Christopher Faulet Date: Tue, 19 May 2026 14:41:45 +0000 (+0200) Subject: MINOR: haterm: Don't init haterm master pipe if not used X-Git-Tag: v3.4-dev13~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1279bd80e9da7b16da2819cc7d113b8236c20e42;p=thirdparty%2Fhaproxy.git MINOR: haterm: Don't init haterm master pipe if not used There is no reason to initialize the haterm master pipe if haterm is not used. So now, it is only performed if a non-disabled haterm frontend is found. To do so, in addition to test the proxy's flags and capabilities, we also check if "stream_new_from_sc" points on "hstream_new". --- diff --git a/src/haterm.c b/src/haterm.c index 2aefd0af1..d51d1bf46 100644 --- a/src/haterm.c +++ b/src/haterm.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -1223,11 +1223,22 @@ static int hstream_build_responses(void) #if defined(USE_LINUX_SPLICE) static void hstream_init_splicing(void) { + struct proxy *px; unsigned int pipesize = 65536; + int haterm_used = 0; if (!(global.tune.options & GTUNE_USE_SPLICE) || !global.maxpipes) return; + for (px = proxies_list; px; px = px->next) { + if ((px->cap & PR_CAP_FE) && !(px->flags & PR_FL_DISABLED) && px->stream_new_from_sc == hstream_new) { + haterm_used = 1; + break; + } + } + if (!haterm_used) + return; + if (global.tune.pipesize) pipesize = global.tune.pipesize;