]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: filters: Reset knwon input payload length if a data filter is used
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 18 Sep 2025 06:58:03 +0000 (08:58 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Oct 2025 09:01:37 +0000 (11:01 +0200)
It a data filter is registered on a channel, the corresponding <kip>
field must be reset because the payload may be altered.

src/filters.c

index 22c09581b55e5d5e2f9ee413acb2952eda2c7bae..d786292d367a75736670b9955b7afedd200257ba 100644 (file)
@@ -738,6 +738,7 @@ flt_http_payload(struct stream *s, struct http_msg *msg, unsigned int len)
        htx->flags |= HTX_FL_ALTERED_PAYLOAD;
        if (msg->flags & HTTP_MSGF_XFER_LEN)
                htx->extra = 0;
+       chn_prod(msg->chn)->sedesc->kip = 0;
        DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_FLT_ANA, s);
        return ret;
 }
@@ -1019,6 +1020,7 @@ flt_tcp_payload(struct stream *s, struct channel *chn, unsigned int len)
                *strm_off += ret;
        }
  end:
+       chn_prod(chn)->sedesc->kip = 0;
        DBG_TRACE_LEAVE(STRM_EV_TCP_ANA|STRM_EV_FLT_ANA, s);
        return ret;
 }