]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: sink: Properly get the stream-int in appctx callback functions
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 16 Mar 2022 09:01:26 +0000 (10:01 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 16 Mar 2022 09:01:30 +0000 (10:01 +0100)
The appctx owner is not a stream-interface anymore. It is now a
conn-stream. However, sink code was not updated accordingly. It is now
fixed.

It is 2.6-specific, no backport is needed.

src/sink.c

index aa0ecfa26ecd123ec8acbddaa23b82e7a2547476..dd6f6b04a0d8bc7b14bca5a1e01ae738d498aa52 100644 (file)
@@ -294,7 +294,7 @@ void sink_setup_proxy(struct proxy *px)
  */
 static void sink_forward_io_handler(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
        struct sink *sink = strm_fe(s)->parent;
        struct sink_forward_target *sft = appctx->ctx.sft.ptr;
@@ -433,7 +433,7 @@ close:
  */
 static void sink_forward_oc_io_handler(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
        struct sink *sink = strm_fe(s)->parent;
        struct sink_forward_target *sft = appctx->ctx.sft.ptr;
@@ -580,7 +580,7 @@ void __sink_forward_session_deinit(struct sink_forward_target *sft)
        if (!sft->appctx)
                return;
 
-       si = sft->appctx->owner;
+       si = cs_si(sft->appctx->owner);
        if (!si)
                return;