]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: replace si_{want,stop}_put() with si_rx_endp_{more,done}()
authorWilly Tarreau <w@1wt.eu>
Wed, 14 Nov 2018 16:54:13 +0000 (17:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 18 Nov 2018 20:41:47 +0000 (21:41 +0100)
Here it's only a 1-to-1 replacement.

include/proto/stream_interface.h
src/applet.c
src/flt_spoe.c
src/stream.c
src/stream_interface.c

index fe55288b6165c82a7f9d27ac44e5af9b1320e40e..92cfe4dcddb09a7d087f80f0f5231d5b8ec2fbcc 100644 (file)
@@ -259,12 +259,6 @@ static inline int si_rx_endp_ready(const struct stream_interface *si)
        return !(si->flags & SI_FL_RX_WAIT_EP);
 }
 
-/* Report that a stream interface wants to put some data into the input buffer */
-static inline void si_want_put(struct stream_interface *si)
-{
-       si->flags &= ~SI_FL_RX_WAIT_EP;
-}
-
 /* Report that a stream interface failed to put some data into the input buffer */
 static inline void si_cant_put(struct stream_interface *si)
 {
@@ -272,16 +266,22 @@ static inline void si_cant_put(struct stream_interface *si)
        si->flags &= ~SI_FL_RX_WAIT_EP;
 }
 
-/* Report that a stream interface doesn't want to put data into the input buffer */
-static inline void si_stop_put(struct stream_interface *si)
+/* Report that a stream interface won't put any more data into the input buffer */
+static inline void si_done_put(struct stream_interface *si)
 {
+       si->flags &= ~SI_FL_RXBLK_ROOM;
        si->flags |=  SI_FL_RX_WAIT_EP;
 }
 
-/* Report that a stream interface won't put any more data into the input buffer */
-static inline void si_done_put(struct stream_interface *si)
+/* The stream interface announces it is ready to try to deliver more data to the input buffer */
+static inline void si_rx_endp_more(struct stream_interface *si)
+{
+       si->flags &= ~SI_FL_RX_WAIT_EP;
+}
+
+/* The stream interface announces it doesn't have more data for the input buffer */
+static inline void si_rx_endp_done(struct stream_interface *si)
 {
-       si->flags &= ~SI_FL_RXBLK_ROOM;
        si->flags |=  SI_FL_RX_WAIT_EP;
 }
 
index 1fe45310788b7bc862bd0facd4d7846cd16adb3d..9c591c760a185d2718996e182226855a888c9b53 100644 (file)
@@ -71,7 +71,7 @@ struct task *task_run_applet(struct task *t, void *context, unsigned short state
         * that one applet which ignores any event will not spin.
         */
        si_cant_get(si);
-       si_stop_put(si);
+       si_rx_endp_done(si);
 
        /* Now we'll try to allocate the input buffer. We wake up the applet in
         * all cases. So this is the applet's responsibility to check if this
@@ -80,7 +80,7 @@ struct task *task_run_applet(struct task *t, void *context, unsigned short state
         * do if it needs the buffer, it will be called again upon readiness.
         */
        if (!si_alloc_ibuf(si, &app->buffer_wait))
-               si_want_put(si);
+               si_rx_endp_more(si);
 
        app->applet->fct(app);
        si_applet_wake_cb(si);
index cd0b88a94284664284f4444449fa19f1a555a1aa..edb853a6623255881643c563482d15b83713d8a1 100644 (file)
@@ -1201,7 +1201,7 @@ static int
 spoe_wakeup_appctx(struct appctx *appctx)
 {
        si_want_get(appctx->owner);
-       si_want_put(appctx->owner);
+       si_rx_endp_more(appctx->owner);
        appctx_wakeup(appctx);
        return 1;
 }
@@ -1338,7 +1338,7 @@ spoe_handle_connect_appctx(struct appctx *appctx)
        int   ret;
 
        if (si->state <= SI_ST_CON) {
-               si_want_put(si);
+               si_rx_endp_more(si);
                task_wakeup(si_strm(si)->task, TASK_WOKEN_MSG);
                goto stop;
        }
index dec9e84b507a61c77bbdb387b111cba3739f137c..da528b26e3d171ee818d00464bda01bddfa9b211 100644 (file)
@@ -852,7 +852,7 @@ static void sess_establish(struct stream *s)
                        rep->analysers |= AN_RES_FLT_HTTP_HDRS;
        }
 
-       si_want_put(si);
+       si_rx_endp_more(si);
        rep->flags |= CF_READ_ATTACHED; /* producer is now attached */
        if (req->flags & CF_WAKE_CONNECT) {
                req->flags |= CF_WAKE_ONCE;
index f4beccb288d2dd4c544c5c973fe915142813dd37..cb73900e56d5f39e429a5a4990393e4292fa1a62 100644 (file)
@@ -1137,7 +1137,7 @@ int si_cs_recv(struct conn_stream *cs)
                goto out_shutdown_r;
 
        /* start by claiming we'll want to receive and change our mind later if needed */
-       si_want_put(si);
+       si_rx_endp_more(si);
 
        if ((ic->flags & (CF_STREAMER | CF_STREAMER_FAST)) && !co_data(ic) &&
            global.tune.idle_timer &&
@@ -1236,7 +1236,7 @@ int si_cs_recv(struct conn_stream *cs)
                        si_cant_put(si);
 
                if (ret <= 0) {
-                       si_stop_put(si);
+                       si_rx_endp_done(si);
                        break;
                }