Skip to content

Commit 47c5f80

Browse files
capflama-denoyelle
authored andcommitted
MEDIUM: stconn: Be able to unblock zero-copy data forwarding from done_fastfwd
This part is only experienced by applet. When an applet try to forward data via an iobuf, it may decide to block for any reason even if there is free space in the buffer. For instance, the stats applet don't procude data if the buffer is almost full. However, in this case, it could be good to let the consumer decide a new attempt is possible because more space was made. So, if IOBUF_FL_FF_BLOCKED flag is removed by the consumer when done_fastfwd() callback function is called, the SE_FL_WANT_ROOM flag is removed on the producer sedesc. It is only done for applets. And thanks to this change, the applet can be woken up for a new attempt. This patch is required for a fix on the QUIC multiplexer. (cherry picked from commit d2a2014) Signed-off-by: Amaury Denoyelle <[email protected]>
1 parent 1b8593e commit 47c5f80

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/applet.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,9 @@ int appctx_fastfwd(struct stconn *sc, unsigned int count, unsigned int flags)
716716
/* else */
717717
/* applet_have_more_data(appctx); */
718718

719-
if (se_done_ff(sdo) != 0) {
720-
/* Something was forwarding, don't reclaim more room */
719+
if (se_done_ff(sdo) != 0 || !(sdo->iobuf.flags & IOBUF_FL_FF_BLOCKED)) {
720+
/* Something was forwarding or the consumer states it is not
721+
* blocked anyore, don't reclaim more room */
721722
se_fl_clr(appctx->sedesc, SE_FL_WANT_ROOM);
722723
TRACE_STATE("more room available", APPLET_EV_RECV|APPLET_EV_BLK, appctx);
723724
}

0 commit comments

Comments
 (0)