]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: promex: Wait to have the request before sending the response
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 16 Sep 2024 20:29:24 +0000 (22:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 16 Sep 2024 20:56:28 +0000 (22:56 +0200)
It is similar to the previous fix about the stats applet ("BUG/MEDIUM:
cache/stats: Wait to have the request before sending the response").
However, for promex, there is no crash and no obvious issue. But it depends
on the filter. Indeed, the request is used by promex, independantly if it
was considered as forwarded or not. So if it is modified by the filter,
modification are just ignored.

Same bug, same fix. We now wait the request was forwarded before processing
it and produce the response.

addons/promex/service-prometheus.c

index 99aa464825f16612ab49e784b9608b369f5d8cb8..7229930bc4f4b60431e8cd77cfcf19f19c9a01e3 100644 (file)
@@ -2105,6 +2105,10 @@ static void promex_appctx_handle_io(struct appctx *appctx)
 
        switch (appctx->st0) {
                case PROMEX_ST_INIT:
+                       if (!co_data(req)) {
+                               applet_need_more_data(appctx);
+                               goto out;
+                       }
                        ret = promex_parse_uri(appctx, sc);
                        if (ret <= 0) {
                                if (ret == -1)