From: Willy Tarreau Date: Wed, 30 Jan 2019 18:20:09 +0000 (+0100) Subject: BUG/MEDIUM: mux-h2: make sure never to send GOAWAY on too old streams X-Git-Tag: v2.0-dev1~110 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=24ff1f834151727cb107995b72a72e9992fd8159;p=haproxy-2.1.git BUG/MEDIUM: mux-h2: make sure never to send GOAWAY on too old streams The H2 spec requires to send GOAWAY when the client sends a frame after it has already closed using END_STREAM. Here the corresponding case was the fallback of a series of tests on the stream state, but it unfortunately also catches old closed streams which we don't know anymore. Thus any late packet after we've sent an RST_STREAM will trigger this GOAWAY and break other streams on the connection. This can happen when launching two tabs in a browser targetting the same slow page through an H2-to-H2 proxy, and pressing Escape to stop one of them. The other one gets an error when the page finally responds (and it generally retries), and the logs in the middle indicate SD-- flags since the late response was cancelled. This patch takes care to only send GOAWAY on streams we still know. It must be backported to 1.9 and 1.8. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 35bdd17..3a47d39 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -2388,7 +2388,7 @@ static void h2_process_demux(struct h2c *h2c) * over which it ignores frames and treat frames that * arrive after this time as being in error. */ - if (!(h2s->flags & H2_SF_RST_SENT)) { + if (h2s->id && !(h2s->flags & H2_SF_RST_SENT)) { /* RFC7540#5.1:closed: any frame other than * PRIO/WU/RST in this state MUST be treated as * a connection error