From: Willy Tarreau Date: Sat, 4 Nov 2023 07:12:17 +0000 (+0100) Subject: MINOR: mux-h2: always use h2_send() in h2_done_ff(), not h2_process() X-Git-Tag: v2.9-dev9~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fa5adee3bb17814b80ddfb5e07f5e219efcfebd;p=thirdparty%2Fhaproxy.git MINOR: mux-h2: always use h2_send() in h2_done_ff(), not h2_process() By calling h2_process(), the code would theoretically make it possible for a synchronous ->wake() call to provoke an indirect call to h2_snd_buf() while we're in h2_done_ff(), which could be quite bad. The current conditions do not permit it right now but this could easily break by accident. Better use h2_send() and wake the task up if needed. Precise performance tests showed no change. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 785fbd9cdc..d0ab3c8a01 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -7070,7 +7070,8 @@ static void h2_done_ff(struct stconn *sc) b_add(mbuf, 9); h2s->sws -= sd->iobuf.data; h2c->mws -= sd->iobuf.data; - h2_process(h2c); + if (h2_send(h2s->h2c)) + tasklet_wakeup(h2s->h2c->wait_event.tasklet); end: sd->iobuf.buf = NULL;