]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: conn-stream: Rename cs_conn_close() and cs_conn_drain_and_close()
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Apr 2022 06:38:54 +0000 (08:38 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 Apr 2022 12:14:27 +0000 (14:14 +0200)
These functions don't close the connection but only perform shutdown for
reads and writes at the mux level. It is a bit ambiguous. Thus,
cs_conn_close() is renamed cs_conn_shut() and cs_conn_drain_and_close() is
renamed cs_conn_drain_and_shut(). These both functions rely on
cs_conn_shutw() and cs_conn_shutr().

include/haproxy/conn_stream.h
src/check.c
src/conn_stream.c

index ee5a3de3d1f285fb3b4be95342c06490e9a38860..604ccd4344a745ba46d32db9f480869a66641a93 100644 (file)
@@ -193,14 +193,14 @@ static inline void cs_conn_shutw(struct conn_stream *cs, enum co_shw_mode mode)
 }
 
 /* completely close a conn_stream (but do not detach it) */
-static inline void cs_conn_close(struct conn_stream *cs)
+static inline void cs_conn_shut(struct conn_stream *cs)
 {
        cs_conn_shutw(cs, CO_SHW_SILENT);
        cs_conn_shutr(cs, CO_SHR_RESET);
 }
 
 /* completely close a conn_stream after draining possibly pending data (but do not detach it) */
-static inline void cs_conn_drain_and_close(struct conn_stream *cs)
+static inline void cs_conn_drain_and_shut(struct conn_stream *cs)
 {
        cs_conn_shutw(cs, CO_SHW_SILENT);
        cs_conn_shutr(cs, CO_SHR_DRAIN);
index defe296baeca6516d642465dd38e2d0f3ca663dc..71d3f3cdd5d90266592cf9b8d957db2831ca3f8f 100644 (file)
@@ -1054,7 +1054,7 @@ static int wake_srv_chk(struct conn_stream *cs)
                 * handled ASAP. */
                ret = -1;
                if (conn)  {
-                       cs_conn_drain_and_close(cs);
+                       cs_conn_drain_and_shut(cs);
                        if (check->wait_list.events)
                                conn->mux->unsubscribe(cs, check->wait_list.events, &check->wait_list);
                }
@@ -1188,7 +1188,7 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
                 * as a failed response coupled with "observe layer7" caused the
                 * server state to be suddenly changed.
                 */
-               cs_conn_drain_and_close(cs);
+               cs_conn_drain_and_shut(cs);
        }
 
        if (cs) {
index 2a3ff564ad750f1ae116520acf2fe405dcf9764d..e37e8ea824b62227887aa7d4c203b3297bd6402c 100644 (file)
@@ -645,7 +645,7 @@ static void cs_app_shutr_conn(struct conn_stream *cs)
                return;
 
        if (cs_oc(cs)->flags & CF_SHUTW) {
-               cs_conn_close(cs);
+               cs_conn_shut(cs);
                cs->state = CS_ST_DIS;
                __cs_strm(cs)->conn_exp = TICK_ETERNITY;
        }
@@ -721,7 +721,7 @@ static void cs_app_shutw_conn(struct conn_stream *cs)
                /* we may have to close a pending connection, and mark the
                 * response buffer as shutr
                 */
-               cs_conn_close(cs);
+               cs_conn_shut(cs);
                /* fall through */
        case CS_ST_CER:
        case CS_ST_QUE:
@@ -1252,7 +1252,7 @@ static void cs_conn_read0(struct conn_stream *cs)
 
  do_close:
        /* OK we completely close the socket here just as if we went through cs_shut[rw]() */
-       cs_conn_close(cs);
+       cs_conn_shut(cs);
 
        oc->flags &= ~CF_SHUTW_NOW;
        oc->flags |= CF_SHUTW;