]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h2: make use of h2s_alert() to report aborts
authorWilly Tarreau <w@1wt.eu>
Wed, 19 Dec 2018 16:44:55 +0000 (17:44 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 19 Dec 2018 17:13:52 +0000 (18:13 +0100)
If we had no pending read, it could be complicated to report an
RST_STREAM to a sender since we used to only report it via the
rx side if subscribed. Similarly in h2_wake_some_streams() we
now try all methods, hoping to catch all possible events.

No backport is needed.

src/mux_h2.c

index 11f1a6c59432a7688614b43d3be2d9fc51f21c5b..aef6d38049d39105962868f72f49ae29e713b828 100644 (file)
@@ -1313,13 +1313,7 @@ static void h2_wake_some_streams(struct h2c *h2c, int last, uint32_t flags)
                if ((flags & CS_FL_ERR_PENDING) && (h2s->cs->flags & CS_FL_EOS))
                        h2s->cs->flags |= CS_FL_ERROR;
 
-               if (h2s->recv_wait) {
-                       struct wait_event *sw = h2s->recv_wait;
-                       sw->events &= ~SUB_RETRY_RECV;
-                       tasklet_wakeup(sw->task);
-                       h2s->recv_wait = NULL;
-               } else if (h2s->cs->data_cb->wake != NULL)
-                       h2s->cs->data_cb->wake(h2s->cs);
+               h2s_alert(h2s);
 
                if (flags & CS_FL_ERR_PENDING && h2s->st < H2_SS_ERROR)
                        h2s->st = H2_SS_ERROR;
@@ -1797,13 +1791,7 @@ static int h2c_handle_rst_stream(struct h2c *h2c, struct h2s *h2s)
                else
                        h2s->cs->flags |= CS_FL_REOS | CS_FL_ERR_PENDING;
 
-               if (h2s->recv_wait) {
-                       struct wait_event *sw = h2s->recv_wait;
-
-                       sw->events &= ~SUB_RETRY_RECV;
-                       tasklet_wakeup(sw->task);
-                       h2s->recv_wait = NULL;
-               }
+               h2s_alert(h2s);
        }
 
        h2s->flags |= H2_SF_RST_RCVD;