]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: muxes: Remove useless calls to b_realign_if_empty()
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 4 Feb 2021 10:13:43 +0000 (11:13 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 11 Feb 2021 10:48:36 +0000 (11:48 +0100)
In H1, H2 and FCGI muxes, b_realign_if_empty() is called to reset the head
of an empty buffer before setting it a specific value to permit the
zero-copy. Thus, we can remove call to b_realign_if_empty().

src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c

index 3e1cff85208a5bf22e990663cbb829607dbaa7f0..2cc517708ae6617e6c062813c2124fa89261aea3 100644 (file)
@@ -2788,7 +2788,6 @@ static int fcgi_recv(struct fcgi_conn *fconn)
                return 0;
        }
 
-       b_realign_if_empty(buf);
        if (!b_data(buf)) {
                /* try to pre-align the buffer like the
                 * rxbufs will be to optimize memory copies. We'll make
index 4262b541e68c8b8b1e49f17a58405f2b95b7202c..a3aa3889edb3412e174df8b59a5e80ea6738520b 100644 (file)
@@ -2547,7 +2547,6 @@ static int h1_recv(struct h1c *h1c)
                        TRACE_STATE("h1c ibuf not full anymore", H1_EV_H1C_RECV|H1_EV_H1C_BLK);
                }
 
-               b_realign_if_empty(&h1c->ibuf);
                if (!b_data(&h1c->ibuf)) {
                        /* try to pre-align the buffer like the rxbufs will be
                         * to optimize memory copies.
index 5f35d8928dddf05b8fde4c524447c9c03eda86ef..4d7142247bbdc2d3ac4af07519e6f39e0a57e0bb 100644 (file)
@@ -3617,7 +3617,6 @@ static int h2_recv(struct h2c *h2c)
                return 0;
        }
 
-       b_realign_if_empty(buf);
        if (!b_data(buf)) {
                /* try to pre-align the buffer like the
                 * rxbufs will be to optimize memory copies. We'll make