]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int/conn-stream: Move si_shut* and si_chk* in conn-stream scope
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 31 Mar 2022 15:44:45 +0000 (17:44 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Apr 2022 13:10:15 +0000 (15:10 +0200)
si_shutr(), si_shutw(), si_chk_rcv() and si_chk_snd() are moved in the
conn-stream scope and renamed, respectively, cs_shutr(), cs_shutw(),
cs_chk_rcv(), cs_chk_snd() and manipulate a conn-stream instead of a
stream-interface.

17 files changed:
addons/promex/service-prometheus.c
include/haproxy/stream_interface.h
src/backend.c
src/cache.c
src/cli.c
src/dns.c
src/flt_spoe.c
src/hlua.c
src/http_ana.c
src/http_client.c
src/log.c
src/peers.c
src/sink.c
src/stats.c
src/stream.c
src/stream_interface.c
src/tcp_rules.c

index 514d16dd488d1d455ed82c78207545e222a310bf..85604093dc5ea202538f5eee9b7adaea990a4503 100644 (file)
@@ -1533,7 +1533,7 @@ static void promex_appctx_handle_io(struct appctx *appctx)
                case PROMEX_ST_END:
                        if (!(res->flags & CF_SHUTR)) {
                                res->flags |= CF_READ_NULL;
-                               si_shutr(cs->si);
+                               cs_shutr(cs);
                        }
        }
 
@@ -1549,8 +1549,8 @@ static void promex_appctx_handle_io(struct appctx *appctx)
 
   error:
        res->flags |= CF_READ_NULL;
-       si_shutr(cs->si);
-       si_shutw(cs->si);
+       cs_shutr(cs);
+       cs_shutw(cs);
 }
 
 struct applet promex_applet = {
index ce2e4595f43581500ee7a7a34c628da6f7b47c73..2a75d6a6e6448aa8f12428c637c1dcce87e87f9b 100644 (file)
@@ -273,43 +273,43 @@ static inline int si_alloc_ibuf(struct stream_interface *si, struct buffer_wait
        return ret;
 }
 
-/* Sends a shutr to the connection using the data layer */
-static inline void si_shutr(struct stream_interface *si)
+/* Sends a shutr to the endpoint using the data layer */
+static inline void cs_shutr(struct conn_stream *cs)
 {
-       si->ops->shutr(si);
+       cs->si->ops->shutr(cs->si);
 }
 
-/* Sends a shutw to the connection using the data layer */
-static inline void si_shutw(struct stream_interface *si)
+/* Sends a shutw to the endpoint using the data layer */
+static inline void cs_shutw(struct conn_stream *cs)
 {
-       si->ops->shutw(si);
+       cs->si->ops->shutw(cs->si);
 }
 
 /* This is to be used after making some room available in a channel. It will
- * return without doing anything if the stream interface's RX path is blocked.
+ * return without doing anything if the conn-stream's RX path is blocked.
  * It will automatically mark the stream interface as busy processing the end
  * point in order to avoid useless repeated wakeups.
  * It will then call ->chk_rcv() to enable receipt of new data.
  */
-static inline void si_chk_rcv(struct stream_interface *si)
+static inline void cs_chk_rcv(struct conn_stream *cs)
 {
-       if (si->flags & SI_FL_RXBLK_CONN && cs_state_in(si_opposite(si)->cs->state, CS_SB_RDY|CS_SB_EST|CS_SB_DIS|CS_SB_CLO))
-               si_rx_conn_rdy(si);
+       if (cs->si->flags & SI_FL_RXBLK_CONN && cs_state_in(cs_opposite(cs)->state, CS_SB_RDY|CS_SB_EST|CS_SB_DIS|CS_SB_CLO))
+               si_rx_conn_rdy(cs->si);
 
-       if (si_rx_blocked(si) || !si_rx_endp_ready(si))
+       if (si_rx_blocked(cs->si) || !si_rx_endp_ready(cs->si))
                return;
 
-       if (!cs_state_in(si->cs->state, CS_SB_RDY|CS_SB_EST))
+       if (!cs_state_in(cs->state, CS_SB_RDY|CS_SB_EST))
                return;
 
-       si->flags |= SI_FL_RX_WAIT_EP;
-       si->ops->chk_rcv(si);
+       cs->si->flags |= SI_FL_RX_WAIT_EP;
+       cs->si->ops->chk_rcv(cs->si);
 }
 
-/* Calls chk_snd on the connection using the data layer */
-static inline void si_chk_snd(struct stream_interface *si)
+/* Calls chk_snd on the endpoint using the data layer */
+static inline void cs_chk_snd(struct conn_stream *cs)
 {
-       si->ops->chk_snd(si);
+       cs->si->ops->chk_snd(cs->si);
 }
 
 /* Combines both si_update_rx() and si_update_tx() at once */
index 65ded4bd1c1199b1701a4bf19ef557c2660a4376..8dc7d1a33d4fead32dc178b18a6f7044648c997a 100644 (file)
@@ -1983,8 +1983,8 @@ void back_try_conn_req(struct stream *s)
                                process_srv_queue(srv);
 
                        /* Failed and not retryable. */
-                       si_shutr(cs->si);
-                       si_shutw(cs->si);
+                       cs_shutr(cs);
+                       cs_shutw(cs);
                        req->flags |= CF_WRITE_ERROR;
 
                        s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
@@ -2043,8 +2043,8 @@ void back_try_conn_req(struct stream *s)
                        if (srv)
                                _HA_ATOMIC_INC(&srv->counters.failed_conns);
                        _HA_ATOMIC_INC(&s->be->be_counters.failed_conns);
-                       si_shutr(cs->si);
-                       si_shutw(cs->si);
+                       cs_shutr(cs);
+                       cs_shutw(cs);
                        req->flags |= CF_WRITE_TIMEOUT;
                        if (!s->conn_err_type)
                                s->conn_err_type = STRM_ET_QUEUE_TO;
@@ -2103,8 +2103,8 @@ abort_connection:
        /* give up */
        s->conn_exp = TICK_ETERNITY;
        s->flags &= ~SF_CONN_EXP;
-       si_shutr(cs->si);
-       si_shutw(cs->si);
+       cs_shutr(cs);
+       cs_shutw(cs);
        cs->state = CS_ST_CLO;
        if (s->srv_error)
                s->srv_error(s, cs->si);
@@ -2141,8 +2141,8 @@ void back_handle_st_req(struct stream *s)
                         */
                        s->flags &= ~(SF_ERR_MASK | SF_FINST_MASK);
 
-                       si_shutr(cs->si);
-                       si_shutw(cs->si);
+                       cs_shutr(cs);
+                       cs_shutw(cs);
                        s->req.flags |= CF_WRITE_ERROR;
                        s->conn_err_type = STRM_ET_CONN_RES;
                        cs->state = CS_ST_CLO;
@@ -2175,8 +2175,8 @@ void back_handle_st_req(struct stream *s)
                }
 
                /* we did not get any server, let's check the cause */
-               si_shutr(cs->si);
-               si_shutw(cs->si);
+               cs_shutr(cs);
+               cs_shutw(cs);
                s->req.flags |= CF_WRITE_ERROR;
                if (!s->conn_err_type)
                        s->conn_err_type = STRM_ET_CONN_OTHER;
@@ -2217,7 +2217,7 @@ void back_handle_st_con(struct stream *s)
            ((req->flags & CF_SHUTW_NOW) &&
             (channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
                cs->flags |= CS_FL_NOLINGER;
-               si_shutw(cs->si);
+               cs_shutw(cs);
                s->conn_err_type |= STRM_ET_CONN_ABRT;
                if (s->srv_error)
                        s->srv_error(s, cs->si);
@@ -2312,8 +2312,8 @@ void back_handle_st_cer(struct stream *s)
                if (may_dequeue_tasks(objt_server(s->target), s->be))
                        process_srv_queue(objt_server(s->target));
 
-               /* shutw is enough so stop a connecting socket */
-               si_shutw(cs->si);
+               /* shutw is enough to stop a connecting socket */
+               cs_shutw(cs);
                s->req.flags |= CF_WRITE_ERROR;
                s->res.flags |= CF_READ_ERROR;
 
@@ -2346,8 +2346,8 @@ void back_handle_st_cer(struct stream *s)
                if (may_dequeue_tasks(objt_server(s->target), s->be))
                        process_srv_queue(objt_server(s->target));
 
-               /* shutw is enough so stop a connecting socket */
-               si_shutw(cs->si);
+               /* shutw is enough to stop a connecting socket */
+               cs_shutw(cs);
                s->req.flags |= CF_WRITE_ERROR;
                s->res.flags |= CF_READ_ERROR;
 
@@ -2433,7 +2433,7 @@ void back_handle_st_rdy(struct stream *s)
                     (channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
                        /* give up */
                        cs->flags |= CS_FL_NOLINGER;
-                       si_shutw(cs->si);
+                       cs_shutw(cs);
                        s->conn_err_type |= STRM_ET_CONN_ABRT;
                        if (s->srv_error)
                                s->srv_error(s, cs->si);
index 8157631230d24b053169a0be7a451362b52de608..ea3438e5ed540ed999ada6a4efd898064a201415 100644 (file)
@@ -1510,7 +1510,7 @@ static void http_cache_io_handler(struct appctx *appctx)
   end:
        if (!(res->flags & CF_SHUTR) && appctx->st0 == HTX_CACHE_END) {
                res->flags |= CF_READ_NULL;
-               si_shutr(cs->si);
+               cs_shutr(cs);
        }
 
   out:
index 6039fb926f226b6ea1fb4b48f18d435e2e45772c..f5c3811d87bf8e7972cd58d7b32cf53f92e3a0ef 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -907,7 +907,7 @@ static void cli_io_handler(struct appctx *appctx)
                        /* Let's close for real now. We just close the request
                         * side, the conditions below will complete if needed.
                         */
-                       si_shutw(cs->si);
+                       cs_shutw(cs);
                        free_trash_chunk(appctx->chunk);
                        appctx->chunk = NULL;
                        break;
@@ -1154,7 +1154,7 @@ static void cli_io_handler(struct appctx *appctx)
                 * we forward the close to the request side so that it flows upstream to
                 * the client.
                 */
-               si_shutw(cs->si);
+               cs_shutw(cs);
        }
 
        if ((req->flags & CF_SHUTW) && (cs->state == CS_ST_EST) && (appctx->st0 < CLI_ST_OUTPUT)) {
@@ -1164,7 +1164,7 @@ static void cli_io_handler(struct appctx *appctx)
                 * the client side has closed. So we'll forward this state downstream
                 * on the response buffer.
                 */
-               si_shutr(cs->si);
+               cs_shutr(cs);
                res->flags |= CF_READ_NULL;
        }
 
@@ -2685,8 +2685,8 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
                pcli_write_prompt(s);
 
                s->csb->flags |= CS_FL_NOLINGER | CS_FL_NOHALF;
-               si_shutr(cs_si(s->csb));
-               si_shutw(cs_si(s->csb));
+               cs_shutr(s->csb);
+               cs_shutw(s->csb);
 
                /*
                 * starting from there this the same code as
index a4adbf832f306406444cf3e5f093b2f9012a4c31..59b921c1f4e098558240aa2d3c51aac65a2c7e76 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -736,8 +736,8 @@ read:
 
        return;
 close:
-       si_shutw(cs->si);
-       si_shutr(cs->si);
+       cs_shutw(cs);
+       cs_shutr(cs);
        cs_ic(cs)->flags |= CF_READ_NULL;
 }
 
index b082c4b447630cacfe39cd9bc88c1342bb579334..348608ebff27402ecc1f5f8a9b64fe36857d943c 100644 (file)
@@ -1254,8 +1254,8 @@ spoe_release_appctx(struct appctx *appctx)
                if (spoe_appctx->status_code == SPOE_FRM_ERR_NONE)
                        spoe_appctx->status_code = SPOE_FRM_ERR_IO;
 
-               si_shutw(cs->si);
-               si_shutr(cs->si);
+               cs_shutw(cs);
+               cs_shutr(cs);
                cs_ic(cs)->flags |= CF_READ_NULL;
        }
 
@@ -1960,8 +1960,8 @@ spoe_handle_appctx(struct appctx *appctx)
                        appctx->st0 = SPOE_APPCTX_ST_END;
                        SPOE_APPCTX(appctx)->task->expire = TICK_ETERNITY;
 
-                       si_shutw(cs->si);
-                       si_shutr(cs->si);
+                       cs_shutw(cs);
+                       cs_shutr(cs);
                        cs_ic(cs)->flags |= CF_READ_NULL;
                        /* fall through */
 
index c16dbf5ad55c58aa5c720e45cdbb50f372bd5337..449452576fbba55c263e617a27b89e9d05bc033c 100644 (file)
@@ -1912,8 +1912,8 @@ static void hlua_socket_handler(struct appctx *appctx)
        struct conn_stream *cs = appctx->owner;
 
        if (appctx->ctx.hlua_cosocket.die) {
-               si_shutw(cs->si);
-               si_shutr(cs->si);
+               cs_shutw(cs);
+               cs_shutr(cs);
                cs_ic(cs)->flags |= CF_READ_NULL;
                notification_wake(&appctx->ctx.hlua_cosocket.wake_on_read);
                notification_wake(&appctx->ctx.hlua_cosocket.wake_on_write);
@@ -9296,7 +9296,7 @@ void hlua_applet_tcp_fct(struct appctx *ctx)
                /* eat the whole request */
                co_skip(cs_oc(cs), co_data(cs_oc(cs)));
                res->flags |= CF_READ_NULL;
-               si_shutr(cs->si);
+               cs_shutr(cs);
                return;
 
        /* yield. */
@@ -9341,8 +9341,8 @@ void hlua_applet_tcp_fct(struct appctx *ctx)
 error:
 
        /* For all other cases, just close the stream. */
-       si_shutw(cs->si);
-       si_shutr(cs->si);
+       cs_shutw(cs);
+       cs_shutr(cs);
        ctx->ctx.hlua_apptcp.flags |= APPLET_DONE;
 }
 
@@ -9576,7 +9576,7 @@ void hlua_applet_http_fct(struct appctx *ctx)
        if (ctx->ctx.hlua_apphttp.flags & APPLET_DONE) {
                if (!(res->flags & CF_SHUTR)) {
                        res->flags |= CF_READ_NULL;
-                       si_shutr(cs->si);
+                       cs_shutr(cs);
                }
 
                /* eat the whole request */
index 6051c7b7a1645539a68c8d11c7d1e27b14804a2c..0a47f1b2e4533f937b67653f1bad792c9efdaf48 100644 (file)
@@ -4260,8 +4260,8 @@ void http_perform_server_redirect(struct stream *s, struct stream_interface *si)
                goto fail;
 
        /* return without error. */
-       si_shutr(si);
-       si_shutw(si);
+       cs_shutr(si->cs);
+       cs_shutw(si->cs);
        s->conn_err_type = STRM_ET_NONE;
        si->cs->state = CS_ST_CLO;
 
index 7adc82de9e49fdb6470a0be55b8da0fd8db5d068..cdd0d873146257df7bd1eefbfb381c3f90d116f9 100644 (file)
@@ -211,8 +211,8 @@ static int hc_cli_io_handler(struct appctx *appctx)
 
        /* we must close only if F_END is the last flag */
        if (appctx->ctx.cli.i0 ==  HC_CLI_F_RES_END) {
-               si_shutw(cs->si);
-               si_shutr(cs->si);
+               cs_shutw(cs);
+               cs_shutr(cs);
                appctx->ctx.cli.i0 &= ~HC_CLI_F_RES_END;
                goto out;
        }
@@ -948,8 +948,8 @@ more:
        return;
 
 end:
-       si_shutw(cs->si);
-       si_shutr(cs->si);
+       cs_shutw(cs);
+       cs_shutr(cs);
        return;
 }
 
index c0c3e29084b0f138f33725336a67db288c1a230a..5897d2ff4f849128779d06925f318a43c2506b5e 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -3682,8 +3682,8 @@ cli_abort:
        _HA_ATOMIC_INC(&frontend->fe_counters.cli_aborts);
 
 close:
-       si_shutw(cs->si);
-       si_shutr(cs->si);
+       cs_shutw(cs);
+       cs_shutr(cs);
 
        cs_ic(cs)->flags |= CF_READ_NULL;
 
index d77010d0975d111b09ac1e0dd00af80115154e60..a6544a27c3966d8955c73ec09d3825947d6f7dd3 100644 (file)
@@ -3099,8 +3099,8 @@ send_msgs:
                                        HA_SPIN_UNLOCK(PEER_LOCK, &curpeer->lock);
                                        curpeer = NULL;
                                }
-                               si_shutw(cs->si);
-                               si_shutr(cs->si);
+                               cs_shutw(cs);
+                               cs_shutr(cs);
                                cs_ic(cs)->flags |= CF_READ_NULL;
                                goto out;
                        }
index f739b37f809f6dd673caf1337cd162174f8be187..204f96a4779b5db6e320acc0a29079cc50113fef 100644 (file)
@@ -424,8 +424,8 @@ static void sink_forward_io_handler(struct appctx *appctx)
        return;
 
 close:
-       si_shutw(cs->si);
-       si_shutr(cs->si);
+       cs_shutw(cs);
+       cs_shutr(cs);
        cs_ic(cs)->flags |= CF_READ_NULL;
 }
 
@@ -568,8 +568,8 @@ static void sink_forward_oc_io_handler(struct appctx *appctx)
        return;
 
 close:
-       si_shutw(cs->si);
-       si_shutr(cs->si);
+       cs_shutw(cs);
+       cs_shutr(cs);
        cs_ic(cs)->flags |= CF_READ_NULL;
 }
 
index a8a8238e6fe7bff59b14183c5d97cebee8e5dce3..41ce2822ce951393d6ae218cb93c66e85da92826 100644 (file)
@@ -4340,7 +4340,7 @@ static void http_stats_io_handler(struct appctx *appctx)
        if (appctx->st0 == STAT_HTTP_END) {
                if (!(res->flags & CF_SHUTR)) {
                        res->flags |= CF_READ_NULL;
-                       si_shutr(cs->si);
+                       cs_shutr(cs);
                }
 
                /* eat the whole request */
index ec7c159932c4d57ecf5d2fa5f4e7ad20a4643bbd..bf0895a67f4ac39768a0c006e9f041067760eb56 100644 (file)
@@ -956,7 +956,7 @@ static void back_establish(struct stream *s)
                 * delayed recv here to give a chance to the data to flow back
                 * by the time we process other tasks.
                 */
-               si_chk_rcv(si);
+               cs_chk_rcv(si->cs);
        }
        req->wex = TICK_ETERNITY;
        /* If we managed to get the whole response, and we don't have anything
@@ -1664,26 +1664,26 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
 
                if (unlikely((req->flags & (CF_SHUTW|CF_WRITE_TIMEOUT)) == CF_WRITE_TIMEOUT)) {
                        s->csb->flags |= CS_FL_NOLINGER;
-                       si_shutw(si_b);
+                       cs_shutw(s->csb);
                }
 
                if (unlikely((req->flags & (CF_SHUTR|CF_READ_TIMEOUT)) == CF_READ_TIMEOUT)) {
                        if (s->csf->flags & CS_FL_NOHALF)
                                s->csf->flags |= CS_FL_NOLINGER;
-                       si_shutr(si_f);
+                       cs_shutr(s->csf);
                }
 
                channel_check_timeouts(res);
 
                if (unlikely((res->flags & (CF_SHUTW|CF_WRITE_TIMEOUT)) == CF_WRITE_TIMEOUT)) {
                        s->csf->flags |= CS_FL_NOLINGER;
-                       si_shutw(si_f);
+                       cs_shutw(s->csf);
                }
 
                if (unlikely((res->flags & (CF_SHUTR|CF_READ_TIMEOUT)) == CF_READ_TIMEOUT)) {
                        if (s->csb->flags & CS_FL_NOHALF)
                                s->csb->flags |= CS_FL_NOLINGER;
-                       si_shutr(si_b);
+                       cs_shutr(s->csb);
                }
 
                if (HAS_FILTERS(s))
@@ -1738,8 +1738,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
        srv = objt_server(s->target);
        if (unlikely(s->csf->endp->flags & CS_EP_ERROR)) {
                if (cs_state_in(s->csf->state, CS_SB_EST|CS_SB_DIS)) {
-                       si_shutr(si_f);
-                       si_shutw(si_f);
+                       cs_shutr(s->csf);
+                       cs_shutw(s->csf);
                        cs_report_error(si_f->cs);
                        if (!(req->analysers) && !(res->analysers)) {
                                _HA_ATOMIC_INC(&s->be->be_counters.cli_aborts);
@@ -1758,8 +1758,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
 
        if (unlikely(s->csb->endp->flags & CS_EP_ERROR)) {
                if (cs_state_in(s->csb->state, CS_SB_EST|CS_SB_DIS)) {
-                       si_shutr(si_b);
-                       si_shutw(si_b);
+                       cs_shutr(s->csb);
+                       cs_shutw(s->csb);
                        cs_report_error(si_b->cs);
                        _HA_ATOMIC_INC(&s->be->be_counters.failed_resp);
                        if (srv)
@@ -2291,7 +2291,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
                     channel_is_empty(req))) {
                if (req->flags & CF_READ_ERROR)
                        s->csb->flags |= CS_FL_NOLINGER;
-               si_shutw(si_b);
+               cs_shutw(s->csb);
        }
 
        /* shutdown(write) done on server side, we must stop the client too */
@@ -2303,7 +2303,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
        if (unlikely((req->flags & (CF_SHUTR|CF_SHUTR_NOW)) == CF_SHUTR_NOW)) {
                if (s->csf->flags & CS_FL_NOHALF)
                        s->csf->flags |= CS_FL_NOLINGER;
-               si_shutr(si_f);
+               cs_shutr(s->csf);
        }
 
        /* Benchmarks have shown that it's optimal to do a full resync now */
@@ -2416,7 +2416,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
        /* shutdown(write) pending */
        if (unlikely((res->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW &&
                     channel_is_empty(res))) {
-               si_shutw(si_f);
+               cs_shutw(s->csf);
        }
 
        /* shutdown(write) done on the client side, we must stop the server too */
@@ -2428,7 +2428,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
        if (unlikely((res->flags & (CF_SHUTR|CF_SHUTR_NOW)) == CF_SHUTR_NOW)) {
                if (s->csb->flags & CS_FL_NOHALF)
                        s->csb->flags |= CS_FL_NOLINGER;
-               si_shutr(si_b);
+               cs_shutr(s->csb);
        }
 
        if (s->csf->state == CS_ST_DIS ||
index 68df64fb3cc10dd3b6ab6af940222481ae584a07..b119cff82002311ef436dd986c2bb47b23bb346f 100644 (file)
@@ -408,7 +408,7 @@ static void stream_int_notify(struct stream_interface *si)
 
                if (((oc->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW) &&
                    (si->cs->state == CS_ST_EST) && (!conn || !(conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS))))
-                       si_shutw(si);
+                       cs_shutw(si->cs);
                oc->wex = TICK_ETERNITY;
        }
 
@@ -457,7 +457,7 @@ static void stream_int_notify(struct stream_interface *si)
                if (ic->pipe)
                        last_len += ic->pipe->data;
 
-               si_chk_snd(sio);
+               cs_chk_snd(sio->cs);
 
                new_len = co_data(ic);
                if (ic->pipe)
@@ -473,14 +473,14 @@ static void stream_int_notify(struct stream_interface *si)
        if (!(ic->flags & CF_DONT_READ))
                si_rx_chan_rdy(si);
 
-       si_chk_rcv(si);
-       si_chk_rcv(sio);
+       cs_chk_rcv(si->cs);
+       cs_chk_rcv(sio->cs);
 
        if (si_rx_blocked(si)) {
                ic->rex = TICK_ETERNITY;
        }
        else if ((ic->flags & (CF_SHUTR|CF_READ_PARTIAL)) == CF_READ_PARTIAL) {
-               /* we must re-enable reading if si_chk_snd() has freed some space */
+               /* we must re-enable reading if cs_chk_snd() has freed some space */
                if (!(ic->flags & CF_READ_NOEXP) && tick_isset(ic->rex))
                        ic->rex = tick_add_ifset(now_ms, ic->rto);
        }
@@ -841,7 +841,7 @@ void si_update_rx(struct stream_interface *si)
        else if (!(ic->flags & CF_READ_NOEXP) && !tick_isset(ic->rex))
                ic->rex = tick_add_ifset(now_ms, ic->rto);
 
-       si_chk_rcv(si);
+       cs_chk_rcv(si->cs);
 }
 
 /* This function is designed to be called from within the stream handler to
@@ -1158,25 +1158,25 @@ static void stream_int_chk_snd_conn(struct stream_interface *si)
                if (((oc->flags & (CF_SHUTW|CF_AUTO_CLOSE|CF_SHUTW_NOW)) ==
                     (CF_AUTO_CLOSE|CF_SHUTW_NOW)) &&
                    cs_state_in(cs->state, CS_SB_RDY|CS_SB_EST)) {
-                       si_shutw(si);
+                       cs_shutw(cs);
                        goto out_wakeup;
                }
 
                if ((oc->flags & (CF_SHUTW|CF_SHUTW_NOW)) == 0)
-                       si->flags |= SI_FL_WAIT_DATA;
+                       cs->si->flags |= SI_FL_WAIT_DATA;
                oc->wex = TICK_ETERNITY;
        }
        else {
                /* Otherwise there are remaining data to be sent in the buffer,
                 * which means we have to poll before doing so.
                 */
-               si->flags &= ~SI_FL_WAIT_DATA;
+               cs->si->flags &= ~SI_FL_WAIT_DATA;
                if (!tick_isset(oc->wex))
                        oc->wex = tick_add_ifset(now_ms, oc->wto);
        }
 
        if (likely(oc->flags & CF_WRITE_ACTIVITY)) {
-               struct channel *ic = si_ic(si);
+               struct channel *ic = cs_ic(cs);
 
                /* update timeout if we have written something */
                if ((oc->flags & (CF_SHUTW|CF_WRITE_PARTIAL)) == CF_WRITE_PARTIAL &&
@@ -1204,8 +1204,8 @@ static void stream_int_chk_snd_conn(struct stream_interface *si)
                   ((channel_is_empty(oc) && !oc->to_forward) ||
                    !cs_state_in(cs->state, CS_SB_EST))))) {
        out_wakeup:
-               if (!(si->cs->flags & CS_FL_DONT_WAKE))
-                       task_wakeup(si_task(si), TASK_WOKEN_IO);
+               if (!(cs->flags & CS_FL_DONT_WAKE))
+                       task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
        }
 }
 
@@ -1575,7 +1575,7 @@ static void stream_int_read0(struct stream_interface *si)
        return;
 
  do_close:
-       /* OK we completely close the socket here just as if we went through si_shut[rw]() */
+       /* OK we completely close the socket here just as if we went through cs_shut[rw]() */
        cs_conn_close(cs);
 
        oc->flags &= ~CF_SHUTW_NOW;
index 4293cbda16d3d60c63d874d8597fb73c4abcbc10..bce62f0090f172d5e9960d7b0a4600a649d015ea 100644 (file)
@@ -394,8 +394,8 @@ resume_execution:
                        else if (rule->action == ACT_TCP_CLOSE) {
                                chn_prod(rep)->flags |= CS_FL_NOLINGER | CS_FL_NOHALF;
                                cs_must_kill_conn(chn_prod(rep));
-                               si_shutr(chn_prod(rep)->si);
-                               si_shutw(chn_prod(rep)->si);
+                               cs_shutr(chn_prod(rep));
+                               cs_shutw(chn_prod(rep));
                                s->last_rule_file = rule->conf.file;
                                s->last_rule_line = rule->conf.line;
                                goto end;