]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: automatically mark applets as ready if they block on the channel
authorWilly Tarreau <w@1wt.eu>
Fri, 16 Nov 2018 15:18:34 +0000 (16:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 18 Nov 2018 20:41:48 +0000 (21:41 +0100)
If an applet reports being blocked due to any of the channel-side flags,
it's reportedly ready to deliver incoming data. It's better to do this
after the return from the applet handler so that applet developers don't
have to worry about details related to flags ordering.

src/stream_interface.c

index e23a283897b7e63b956eecd67f3653f324ff861d..4e63ed2404b82df115034ebbed17ae372689d38b 100644 (file)
@@ -1422,6 +1422,12 @@ void si_applet_wake_cb(struct stream_interface *si)
        if (!(si->flags & SI_FL_RX_WAIT_EP) && (ic->flags & CF_SHUTR))
                si->flags |= SI_FL_ERR;
 
+       /* automatically mark the applet having data available if it reported
+        * begin blocked by the channel.
+        */
+       if (si_rx_blocked(si))
+               si_rx_endp_more(si);
+
        /* update the stream-int, channels, and possibly wake the stream up */
        stream_int_notify(si);