From: Willy Tarreau Date: Thu, 5 Mar 2020 06:41:20 +0000 (+0100) Subject: BUG/MINOR: connection/debug: do not enforce !event_type on subscribe() anymore X-Git-Tag: v2.2-dev4~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4629a5346ea341026e908792a6b31e98022faa1;p=thirdparty%2Fhaproxy.git BUG/MINOR: connection/debug: do not enforce !event_type on subscribe() anymore When building with DEBUG_STRICT, there are still some BUG_ON(events&event_type) in the subscribe() code which are not welcome anymore since we explicitly permit to wake the caller up on readiness. This causes some regtests to fail since 2c1f37d353 ("OPTIM: mux-h1: subscribe rather than waking up at a few other places") when built with this option. No backport is needed, this is 2.2-dev. --- diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index 6a7a13f927..7254add05c 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -3712,7 +3712,6 @@ static int fcgi_subscribe(struct conn_stream *cs, int event_type, struct wait_ev struct fcgi_conn *fconn = fstrm->fconn; BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV)); - BUG_ON(fstrm->subs && fstrm->subs->events & event_type); BUG_ON(fstrm->subs && fstrm->subs != es); es->events |= event_type; diff --git a/src/mux_h1.c b/src/mux_h1.c index a07654b4d6..2e2dbf9435 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2587,7 +2587,6 @@ static int h1_subscribe(struct conn_stream *cs, int event_type, struct wait_even return -1; BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV)); - BUG_ON(h1s->subs && h1s->subs->events & event_type); BUG_ON(h1s->subs && h1s->subs != es); es->events |= event_type; diff --git a/src/mux_h2.c b/src/mux_h2.c index 478f3c4fcf..b8728970ba 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -5611,7 +5611,6 @@ static int h2_subscribe(struct conn_stream *cs, int event_type, struct wait_even TRACE_ENTER(H2_EV_STRM_SEND|H2_EV_STRM_RECV, h2c->conn, h2s); BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV)); - BUG_ON(h2s->subs && h2s->subs->events & event_type); BUG_ON(h2s->subs && h2s->subs != es); es->events |= event_type; diff --git a/src/ssl_sock.c b/src/ssl_sock.c index efb6b0e0e1..2688117e59 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -6473,7 +6473,6 @@ static int ssl_subscribe(struct connection *conn, void *xprt_ctx, int event_type return -1; BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV)); - BUG_ON(ctx->subs && ctx->subs->events & event_type); BUG_ON(ctx->subs && ctx->subs != es); ctx->subs = es; diff --git a/src/xprt_handshake.c b/src/xprt_handshake.c index 89446af37f..bfbd52237c 100644 --- a/src/xprt_handshake.c +++ b/src/xprt_handshake.c @@ -203,7 +203,6 @@ static int xprt_handshake_subscribe(struct connection *conn, void *xprt_ctx, int struct xprt_handshake_ctx *ctx = xprt_ctx; BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV)); - BUG_ON(ctx->subs && ctx->subs->events & event_type); BUG_ON(ctx->subs && ctx->subs != es); ctx->subs = es;