]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h2: Don't forget to destroy the h2s after deferred shut.
authorOlivier Houchard <cognet@ci0.org>
Sat, 15 Dec 2018 21:42:20 +0000 (22:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 15 Dec 2018 22:50:07 +0000 (23:50 +0100)
If we had to defer shutr/shutw, and we're now done, destroy the h2s, or
nobody will do so.

src/mux_h2.c

index d13bd95823a20ae79367b4362c73215c19153a64..a0357be4b78ca4d3e2d4639d03e82bfa0873b625 100644 (file)
@@ -2997,11 +2997,20 @@ static struct task *h2_deferred_shut(struct task *t, void *ctx, unsigned short s
        struct h2s *h2s = ctx;
        long reason = (long)h2s->wait_event.handle;
 
-       if (reason & 1)
-               h2_do_shutr(h2s);
+       if (h2s->send_wait) {
+               h2s->send_wait->wait_reason &= ~SUB_CALL_UNSUBSCRIBE;
+               h2s->send_wait = NULL;
+               LIST_DEL(&h2s->list);
+               LIST_INIT(&h2s->list);
+       }
        if (reason & 2)
                h2_do_shutw(h2s);
+       if (reason & 1)
+               h2_do_shutr(h2s);
 
+       if (h2s->st == H2_SS_CLOSED &&
+           !((h2s->flags & (H2_SF_BLK_MBUSY | H2_SF_BLK_MROOM | H2_SF_BLK_MFCTL))))
+               h2s_destroy(h2s);
        return NULL;
 }