]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stream-int: call stream_int_update() from si_update()
authorWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2015 08:59:38 +0000 (10:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2015 16:07:16 +0000 (18:07 +0200)
Now the call to stream_int_update() is moved to si_update(), which
is exclusively called from the stream, so that the socket layer may
be updated without updating the stream layer. This will later permit
to call it individually from other places (other tasks or applets for
example).

include/proto/stream_interface.h
src/stream_interface.c

index 890bfb8ec613db21e4a3b92f3e00f940e118a50c..84c309091a882dd6f7fd8cb80e8f385f4ea536c5 100644 (file)
@@ -319,9 +319,10 @@ static inline void si_shutw(struct stream_interface *si)
        si->ops->shutw(si);
 }
 
-/* Calls the data state update on the stream interfaace */
+/* Updates the stream interface and timers, then updates the data layer below */
 static inline void si_update(struct stream_interface *si)
 {
+       stream_int_update(si);
        si->ops->update(si);
 }
 
index abd0cee6533dd502433553781de1524838492501..51099b824e6dda0571f614f14534b36d27cbfcac 100644 (file)
@@ -786,9 +786,6 @@ void stream_int_update_conn(struct stream_interface *si)
        struct channel *oc = si_oc(si);
        struct connection *conn = __objt_conn(si->end);
 
-       stream_int_update(si);
-
-       /* now update the connection itself */
        if (!(ic->flags & CF_SHUTR)) {
                /* Read not closed */
                if ((ic->flags & CF_DONT_READ) || !channel_may_recv(ic))
@@ -1486,8 +1483,6 @@ void si_applet_done(struct stream_interface *si)
  */
 void stream_int_update_applet(struct stream_interface *si)
 {
-       stream_int_update(si);
-
        if (((si->flags & (SI_FL_WANT_PUT|SI_FL_WAIT_ROOM)) == SI_FL_WANT_PUT) ||
            ((si->flags & (SI_FL_WANT_GET|SI_FL_WAIT_DATA)) == SI_FL_WANT_GET))
                appctx_wakeup(si_appctx(si));