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.
This commit is contained in:
Willy Tarreau 2018-07-12 11:00:01 +02:00
parent fd8d42f496
commit 0db4d10efc
1 changed files with 3 additions and 3 deletions

View File

@ -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) {