mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 14:51:27 +02:00
MEDIUM: mux-h2: discard contents that are to be sent after a shutdown
In h2_snd_buf() we discard any possible buffer contents requested to be sent after a close or an error. But in practice we can extend this to any case where the stream is locally half-closed since it means we will never be able to send these data anymore. For now it must not change anything, but it will be used by subsequent patches to discard lone a HTX EOM block arriving after the trailers block.
This commit is contained in:
parent
aab1a60977
commit
2b77848418
@ -5377,7 +5377,7 @@ static size_t h2_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (htx) {
|
if (htx) {
|
||||||
while (h2s->st < H2_SS_ERROR && !(h2s->flags & H2_SF_BLK_ANY) &&
|
while (h2s->st < H2_SS_HLOC && !(h2s->flags & H2_SF_BLK_ANY) &&
|
||||||
count && !htx_is_empty(htx)) {
|
count && !htx_is_empty(htx)) {
|
||||||
idx = htx_get_head(htx);
|
idx = htx_get_head(htx);
|
||||||
blk = htx_get_blk(htx, idx);
|
blk = htx_get_blk(htx, idx);
|
||||||
@ -5481,7 +5481,7 @@ static size_t h2_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
|
|||||||
total += ret;
|
total += ret;
|
||||||
count -= ret;
|
count -= ret;
|
||||||
|
|
||||||
if (h2s->st >= H2_SS_ERROR)
|
if (h2s->st >= H2_SS_HLOC)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (h2s->flags & H2_SF_BLK_ANY)
|
if (h2s->flags & H2_SF_BLK_ANY)
|
||||||
@ -5489,7 +5489,7 @@ static size_t h2_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
|
|||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (h2s->st >= H2_SS_ERROR) {
|
if (h2s->st >= H2_SS_HLOC) {
|
||||||
/* trim any possibly pending data after we close (extra CR-LF,
|
/* trim any possibly pending data after we close (extra CR-LF,
|
||||||
* unprocessed trailers, abnormal extra data, ...)
|
* unprocessed trailers, abnormal extra data, ...)
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user