]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: channel: Remove CF_WRITE_ACTIVITY
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Dec 2022 17:18:00 +0000 (18:18 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 9 Jan 2023 17:41:08 +0000 (18:41 +0100)
Thanks to previous changes, CF_WRITE_ACTIVITY flags can be removed.
Everywhere it was used, its value is now directly used
(CF_WRITE_EVENT|CF_WRITE_ERROR).

include/haproxy/channel-t.h
include/haproxy/channel.h
src/stconn.c
src/stream.c

index 5996db427ba82efb92ed672c7fcba4f4999f8c48..c1ae613be12dda6e978e97c173ff4793f5077ade 100644 (file)
@@ -67,7 +67,6 @@
 /* unused: 0x00000200 */
 #define CF_WRITE_TIMEOUT  0x00000400  /* timeout while waiting for consumer */
 #define CF_WRITE_ERROR    0x00000800  /* unrecoverable error on consumer side */
-#define CF_WRITE_ACTIVITY (CF_WRITE_EVENT|CF_WRITE_ERROR)
 
 #define CF_WAKE_WRITE     0x00001000  /* wake the task up when there's write activity */
 #define CF_SHUTW          0x00002000  /* consumer has already shut down */
 #define CF_ISRESP         0x80000000  /* 0 = request channel, 1 = response channel */
 
 /* Masks which define input events for stream analysers */
-#define CF_MASK_ANALYSER  (CF_READ_ATTACHED|CF_READ_EVENT|CF_READ_ERROR|CF_READ_TIMEOUT|CF_ANA_TIMEOUT|CF_WRITE_ACTIVITY|CF_WAKE_ONCE)
+#define CF_MASK_ANALYSER  (CF_READ_ATTACHED|CF_READ_EVENT|CF_READ_ERROR|CF_READ_TIMEOUT|CF_ANA_TIMEOUT|CF_WRITE_EVENT|CF_WRITE_ERROR|CF_WAKE_ONCE)
 
 /* Mask for static flags which cause analysers to be woken up when they change */
 #define CF_MASK_STATIC    (CF_SHUTR|CF_SHUTW|CF_SHUTR_NOW|CF_SHUTW_NOW)
index 3b024e8a739d88229e3602d9a899a987e397f32b..515453c005a3daf7868e57a36c9a9255eb293414 100644 (file)
@@ -534,7 +534,7 @@ static inline void channel_check_timeouts(struct channel *chn)
            unlikely(tick_is_expired(chn->rex, now_ms)))
                chn->flags |= CF_READ_TIMEOUT;
 
-       if (likely(!(chn->flags & (CF_SHUTW|CF_WRITE_TIMEOUT|CF_WRITE_ACTIVITY))) &&
+       if (likely(!(chn->flags & (CF_SHUTW|CF_WRITE_TIMEOUT|CF_WRITE_EVENT|CF_WRITE_ERROR))) &&
            unlikely(tick_is_expired(chn->wex, now_ms)))
                chn->flags |= CF_WRITE_TIMEOUT;
 
index 24b04cc2d6d5a02972b1ed306a16c83f3eaf4d8d..75904238d2c5ff967ae5bdf130a9a99cb429b6bf 100644 (file)
@@ -826,7 +826,7 @@ static void sc_app_chk_snd_conn(struct stconn *sc)
                        oc->wex = tick_add_ifset(now_ms, oc->wto);
        }
 
-       if (likely(oc->flags & CF_WRITE_ACTIVITY)) {
+       if (likely(oc->flags & (CF_WRITE_EVENT|CF_WRITE_ERROR))) {
                struct channel *ic = sc_ic(sc);
 
                /* update timeout if we have written something */
@@ -1126,7 +1126,7 @@ static void sc_notify(struct stconn *sc)
                sc_ep_clr(sc, SE_FL_WAIT_DATA);
 
        /* update OC timeouts and wake the other side up if it's waiting for room */
-       if (oc->flags & CF_WRITE_ACTIVITY) {
+       if (oc->flags & (CF_WRITE_EVENT|CF_WRITE_ERROR)) {
                if ((oc->flags & (CF_SHUTW|CF_WRITE_EVENT)) == CF_WRITE_EVENT &&
                    !channel_is_empty(oc))
                        if (tick_isset(oc->wex))
index f727788c5f15e34ffa3a657a04216249d8358aa4..92aff7717b5c03fea2e6c7e394d05f5b5f5f1fd4 100644 (file)
@@ -1783,7 +1783,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
                 */
                if (!((req->flags | res->flags) &
                      (CF_SHUTR|CF_READ_EVENT|CF_READ_ERROR|CF_READ_TIMEOUT|CF_SHUTW|
-                      CF_WRITE_ACTIVITY|CF_WRITE_TIMEOUT|CF_ANA_TIMEOUT)) &&
+                      CF_WRITE_EVENT|CF_WRITE_ERROR|CF_WRITE_TIMEOUT|CF_ANA_TIMEOUT)) &&
                    !(s->flags & SF_CONN_EXP) &&
                    !((sc_ep_get(scf) | scb->flags) & SE_FL_ERROR) &&
                    ((s->pending_events & TASK_WOKEN_ANY) == TASK_WOKEN_TIMER)) {