mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-29 10:11:49 -04:00
BUG/MINOR: mux-h1: Don't send more data than expected
In h1_snd_buf(), we try to consume as much data as possible in a loop. In this loop, we first format the raw HTTP message from the HTX message, then we try to send it. But we must be carefull to never send more data than specified by the stream-interface. This patch must be backported to 1.9.
This commit is contained in:
parent
54b5e214b0
commit
c31872fc04
1 changed files with 2 additions and 1 deletions
|
|
@ -2347,7 +2347,7 @@ static size_t h1_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
|
|||
if (h1c->flags & H1C_F_CS_WAIT_CONN)
|
||||
return 0;
|
||||
|
||||
while (total != count) {
|
||||
while (count) {
|
||||
size_t ret = 0;
|
||||
|
||||
if (!(h1c->flags & (H1C_F_OUT_FULL|H1C_F_OUT_ALLOC)))
|
||||
|
|
@ -2355,6 +2355,7 @@ static size_t h1_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
|
|||
if (!ret)
|
||||
break;
|
||||
total += ret;
|
||||
count -= ret;
|
||||
if (!h1_send(h1c))
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue