You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.3 KiB

  1. commit 105abe2f7a2e518afda9eb3bda5cceb60f6fd1b2
  2. Author: Olivier Houchard <cognet@ci0.org>
  3. Date: Sun Oct 21 03:01:20 2018 +0200
  4. BUG/MEDIUM: h2: Close connection if no stream is left an GOAWAY was sent.
  5. When we're closing a stream, is there's no stream left and a goaway was sent,
  6. close the connection, there's no reason to keep it open.
  7. [wt: it's likely that this is needed in 1.8 as well, though it's unclear
  8. how to trigger this issue, some tests are needed]
  9. (cherry picked from commit 52b946686c28891a4359e9361676dc62af4fffad)
  10. Signed-off-by: Willy Tarreau <w@1wt.eu>
  11. diff --git a/src/mux_h2.c b/src/mux_h2.c
  12. index b1b039fe..6881302b 100644
  13. --- a/src/mux_h2.c
  14. +++ b/src/mux_h2.c
  15. @@ -2540,7 +2540,7 @@ static void h2_detach(struct conn_stream *cs)
  16. if (eb_is_empty(&h2c->streams_by_id) && /* don't close if streams exist */
  17. ((h2c->conn->flags & CO_FL_ERROR) || /* errors close immediately */
  18. (h2c->st0 >= H2_CS_ERROR && !h2c->task) || /* a timeout stroke earlier */
  19. - (h2c->flags & H2_CF_GOAWAY_FAILED) ||
  20. + (h2c->flags & (H2_CF_GOAWAY_FAILED | H2_CF_GOAWAY_SENT)) ||
  21. (!h2c->mbuf->o && /* mux buffer empty, also process clean events below */
  22. (conn_xprt_read0_pending(h2c->conn) ||
  23. (h2c->last_sid >= 0 && h2c->max_id >= h2c->last_sid))))) {