]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: channel: Forwad close to other side on abort
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 13 Apr 2023 13:13:12 +0000 (15:13 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 14 Apr 2023 11:56:28 +0000 (13:56 +0200)
Most of calls to channel_abort() are associated to a call to
channel_auto_close(). Others are in areas where the auto close is the
default. So, it is now systematically enabled when an abort is performed on
a channel, as part of channel_abort() function.

include/haproxy/channel.h
src/hlua.c
src/http_ana.c
src/stream.c

index 1bf21c7a748ca45e1b6ad9eb4bcd3bdb078120ab..44728bbf6b3a48cb7017628a4aa01901d21cd2fd 100644 (file)
@@ -565,6 +565,7 @@ static inline void channel_abort(struct channel *chn)
 {
        chn_prod(chn)->flags |= SC_FL_SHUTR_NOW;
        chn_cons(chn)->flags |= SC_FL_SHUTW_NOW;
+       chn->flags |= CF_AUTO_CLOSE;
        chn->flags &= ~CF_AUTO_CONNECT;
 }
 
index 6bbf5c97ab739557cb3c33a2e0af514cb8c79717..913b237c9077728d0e5b813e71ad8ae42c8a85cd 100644 (file)
@@ -8158,7 +8158,6 @@ __LJMP static int hlua_txn_done(lua_State *L)
 
                channel_auto_read(req);
                channel_abort(req);
-               channel_auto_close(req);
                channel_erase(req);
 
                channel_auto_read(res);
index bee658f86dcc14ab1d784030418ab6c6608c2768..4dc1b523f74e8308f448ffef4bb3709c9012df7d 100644 (file)
@@ -4446,7 +4446,6 @@ int http_forward_proxy_resp(struct stream *s, int final)
 
                channel_auto_read(req);
                channel_abort(req);
-               channel_auto_close(req);
                channel_htx_erase(req, htxbuf(&req->buf));
 
                channel_auto_read(res);
@@ -4511,7 +4510,6 @@ end:
 
        channel_auto_read(&s->req);
        channel_abort(&s->req);
-       channel_auto_close(&s->req);
        channel_htx_erase(&s->req, htxbuf(&s->req.buf));
        channel_auto_read(&s->res);
        channel_auto_close(&s->res);
index f8fc06203bd12c65683e1eea9aaacbad806a0e27..5afef6c8f99528db0b5a8f0d6998b4a443841825 100644 (file)
@@ -846,7 +846,6 @@ void stream_retnclose(struct stream *s, const struct buffer *msg)
 
        channel_auto_read(ic);
        channel_abort(ic);
-       channel_auto_close(ic);
        channel_erase(ic);
        channel_truncate(oc);