CLEANUP: conn-stream: Rename cs_conn_close() and cs_conn_drain_and_close()
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().
diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h
index ee5a3de..604ccd4 100644
--- a/include/haproxy/conn_stream.h
+++ b/include/haproxy/conn_stream.h
@@ -193,14 +193,14 @@
}
/* 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);
diff --git a/src/check.c b/src/check.c
index defe296..71d3f3c 100644
--- a/src/check.c
+++ b/src/check.c
@@ -1054,7 +1054,7 @@
* 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 @@
* 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) {
diff --git a/src/conn_stream.c b/src/conn_stream.c
index 2a3ff56..e37e8ea 100644
--- a/src/conn_stream.c
+++ b/src/conn_stream.c
@@ -645,7 +645,7 @@
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 @@
/* 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 @@
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;