From: Willy Tarreau Date: Thu, 12 Jul 2018 09:00:01 +0000 (+0200) Subject: MINOR: h2: use b_slow_realign() with the trash as a swap buffer X-Git-Tag: v1.9-dev1~155 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0db4d10efc71f70bc8759ae599e0817cd58a5a45;p=thirdparty%2Fhaproxy.git MINOR: h2: use b_slow_realign() with the trash as a swap buffer H2 doesn't use the trash so it can make use of it as a swap area when calling b_slow_realign(). This way we don't need buffer_slow_realign() anymore. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 3210302613..9a1d71867f 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -2688,7 +2688,7 @@ static int h2_frt_decode_headers(struct h2s *h2s, struct buffer *buf, int count) /* it doesn't fit and the buffer is fragmented, * so let's defragment it and try again. */ - buffer_slow_realign(buf, 0); + b_slow_realign(buf, trash.str, 0); } /* first check if we have some room after p+i */ @@ -2995,7 +2995,7 @@ static int h2s_frt_make_resp_headers(struct h2s *h2s, struct buffer *buf) if (outbuf.size >= 9 || !buffer_space_wraps(h2c->mbuf)) break; realign_again: - buffer_slow_realign(h2c->mbuf, h2c->mbuf->o); + b_slow_realign(h2c->mbuf, trash.str, h2c->mbuf->o); } if (outbuf.size < 9) { @@ -3153,7 +3153,7 @@ static int h2s_frt_make_resp_data(struct h2s *h2s, struct buffer *buf) if (outbuf.size >= 9 || !buffer_space_wraps(h2c->mbuf)) break; realign_again: - buffer_slow_realign(h2c->mbuf, h2c->mbuf->o); + b_slow_realign(h2c->mbuf, trash.str, h2c->mbuf->o); } if (outbuf.size < 9) {