From: Willy Tarreau Date: Sun, 3 Dec 2017 09:27:47 +0000 (+0100) Subject: BUG/MINOR: h2: immediately close if receiving GOAWAY after the last stream X-Git-Tag: v1.9-dev1~623 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11cc2d6031a8fefe78f083c4d364c8489b7dbbaf;p=thirdparty%2Fhaproxy.git BUG/MINOR: h2: immediately close if receiving GOAWAY after the last stream The h2spec test suite reveals that a GOAWAY frame received after the last stream doesn't cause an immediate close, because we count on the last stream to quit to do so. By simply setting the last_sid to the received value in case it was not set, we can ensure to properly close an idle connection during h2_wake(). To be backported to 1.8. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 4567b8ff04..733687e7bf 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -1399,6 +1399,8 @@ static int h2c_handle_goaway(struct h2c *h2c) last = h2_get_n32(h2c->dbuf, 0); h2c->errcode = h2_get_n32(h2c->dbuf, 4); h2_wake_some_streams(h2c, last, CS_FL_ERROR); + if (h2c->last_sid < 0) + h2c->last_sid = last; return 1; conn_err: