From: Christopher Faulet Date: Thu, 4 Feb 2021 10:13:43 +0000 (+0100) Subject: CLEANUP: muxes: Remove useless calls to b_realign_if_empty() X-Git-Tag: v2.4-dev8~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0aeaa290daa492bf770a256ec7f5b9f367bc6378;p=thirdparty%2Fhaproxy.git CLEANUP: muxes: Remove useless calls to b_realign_if_empty() 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(). --- diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index 3e1cff8520..2cc517708a 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -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 diff --git a/src/mux_h1.c b/src/mux_h1.c index 4262b541e6..a3aa3889ed 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -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. diff --git a/src/mux_h2.c b/src/mux_h2.c index 5f35d8928d..4d7142247b 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -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