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().
This commit is contained in:
Christopher Faulet 2022-04-21 08:38:54 +02:00
parent 0264212ba3
commit ff022a2b8c
3 changed files with 7 additions and 7 deletions

View 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);

View 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) {

View 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;