24b508b037770601d03cff0eab30ca8ff52d82ae
[openwrt-packages.git] /
1 From 58cef63f20cc40248cd1cd113571cae588943d06 Mon Sep 17 00:00:00 2001
2 From: Willy Tarreau <w@1wt.eu>
3 Date: Thu, 29 Mar 2018 15:41:32 +0200
4 Subject: [PATCH] BUG/MEDIUM: h2: don't consider pending data on detach if
5  connection is in error
6
7 Interrupting an h2load test shows that some connections remain active till
8 the client timeout. This is due to the fact that h2_detach() immediately
9 returns if the h2s flags indicate that the h2s is still waiting for some
10 buffer room in the output mux (possibly to emit a response or to send some
11 window updates). If the connection is broken, these data will never leave
12 and must not prevent the stream from being terminated nor the connection
13 from being released.
14
15 This fix must be backported to 1.8.
16
17 (cherry picked from commit 3041fcc2fde3f3f33418c9f579b657d993b0006d)
18 Signed-off-by: Willy Tarreau <w@1wt.eu>
19 ---
20  src/mux_h2.c |    3 ++-
21  1 file changed, 2 insertions(+), 1 deletion(-)
22
23 diff --git a/src/mux_h2.c b/src/mux_h2.c
24 index 92fae06..4d30f91 100644
25 --- a/src/mux_h2.c
26 +++ b/src/mux_h2.c
27 @@ -2487,7 +2487,8 @@ static void h2_detach(struct conn_stream *cs)
28         /* this stream may be blocked waiting for some data to leave (possibly
29          * an ES or RST frame), so orphan it in this case.
30          */
31 -       if (h2s->flags & (H2_SF_BLK_MBUSY | H2_SF_BLK_MROOM | H2_SF_BLK_MFCTL))
32 +       if (!(cs->conn->flags & CO_FL_ERROR) &&
33 +           (h2s->flags & (H2_SF_BLK_MBUSY | H2_SF_BLK_MROOM | H2_SF_BLK_MFCTL)))
34                 return;
35  
36         if ((h2c->flags & H2_CF_DEM_BLOCK_ANY && h2s->id == h2c->dsi) ||
37 -- 
38 1.7.10.4
39
git clone https://git.99rst.org/PROJECT