]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h2: Use the new sending_list in h2s_notify_send().
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 25 Mar 2019 13:04:25 +0000 (14:04 +0100)
committerOlivier Houchard <cognet@ci0.org>
Mon, 25 Mar 2019 13:34:26 +0000 (14:34 +0100)
In h2s_notify_send(), use the new sending_list instead of using the old
way of setting hs->send_wait to NULL, failing to do so may lead to crashes.

This should be backported to 1.9.

src/mux_h2.c

index 273bb920181c87c119ee54ead653c03152359804..f179c4a0090798a0326fc77f7c78a1bbc91f5e2b 100644 (file)
@@ -714,13 +714,12 @@ static void __maybe_unused h2s_notify_send(struct h2s *h2s)
 {
        struct wait_event *sw;
 
-       if (h2s->send_wait) {
+       if (h2s->send_wait && !(h2s->send_wait->events & SUB_CALL_UNSUBSCRIBE)) {
                sw = h2s->send_wait;
                sw->events &= ~SUB_RETRY_SEND;
+               sw->events |= SUB_CALL_UNSUBSCRIBE;
+               LIST_ADDQ(&h2s->h2c->sending_list, &h2s->sending_list);
                tasklet_wakeup(sw->task);
-               h2s->send_wait = NULL;
-               LIST_DEL(&h2s->list);
-               LIST_INIT(&h2s->list);
        }
 }