/* Failed and not retryable. */
sc_abort(sc);
- sc_shutw(sc);
+ sc_shutdown(sc);
sc_ep_set(sc, SE_FL_ERROR|SE_FL_EOS);
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
_HA_ATOMIC_INC(&srv->counters.failed_conns);
_HA_ATOMIC_INC(&s->be->be_counters.failed_conns);
sc_abort(sc);
- sc_shutw(sc);
+ sc_shutdown(sc);
req->flags |= CF_WRITE_TIMEOUT;
if (!s->conn_err_type)
s->conn_err_type = STRM_ET_QUEUE_TO;
s->conn_exp = TICK_ETERNITY;
s->flags &= ~SF_CONN_EXP;
sc_abort(sc);
- sc_shutw(sc);
+ sc_shutdown(sc);
sc->state = SC_ST_CLO;
if (s->srv_error)
s->srv_error(s, sc);
s->flags &= ~(SF_ERR_MASK | SF_FINST_MASK);
sc_abort(sc);
- sc_shutw(sc);
+ sc_shutdown(sc);
sc_ep_set(sc, SE_FL_ERROR|SE_FL_EOS);
s->conn_err_type = STRM_ET_CONN_RES;
sc->state = SC_ST_CLO;
/* we did not get any server, let's check the cause */
sc_abort(sc);
- sc_shutw(sc);
+ sc_shutdown(sc);
sc_ep_set(sc, SE_FL_ERROR|SE_FL_EOS);
if (!s->conn_err_type)
s->conn_err_type = STRM_ET_CONN_OTHER;
((chn_cons(req)->flags & SC_FL_SHUT_WANTED) &&
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
sc->flags |= SC_FL_NOLINGER;
- sc_shutw(sc);
+ sc_shutdown(sc);
s->conn_err_type |= STRM_ET_CONN_ABRT;
if (s->srv_error)
s->srv_error(s, sc);
process_srv_queue(objt_server(s->target));
/* shutw is enough to stop a connecting socket */
- sc_shutw(sc);
+ sc_shutdown(sc);
sc_ep_set(sc, SE_FL_ERROR|SE_FL_EOS);
sc->state = SC_ST_CLO;
process_srv_queue(objt_server(s->target));
/* shutw is enough to stop a connecting socket */
- sc_shutw(sc);
+ sc_shutdown(sc);
sc_ep_set(sc, SE_FL_ERROR|SE_FL_EOS);
sc->state = SC_ST_CLO;
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
/* give up */
sc->flags |= SC_FL_NOLINGER;
- sc_shutw(sc);
+ sc_shutdown(sc);
s->conn_err_type |= STRM_ET_CONN_ABRT;
if (s->srv_error)
s->srv_error(s, sc);
/* functions used by default on a detached stream connector */
static void sc_app_abort(struct stconn *sc);
-static void sc_app_shutw(struct stconn *sc);
+static void sc_app_shut(struct stconn *sc);
static void sc_app_chk_rcv(struct stconn *sc);
static void sc_app_chk_snd(struct stconn *sc);
/* functions used on a mux-based stream connector */
static void sc_app_abort_conn(struct stconn *sc);
-static void sc_app_shutw_conn(struct stconn *sc);
+static void sc_app_shut_conn(struct stconn *sc);
static void sc_app_chk_rcv_conn(struct stconn *sc);
static void sc_app_chk_snd_conn(struct stconn *sc);
/* functions used on an applet-based stream connector */
static void sc_app_abort_applet(struct stconn *sc);
-static void sc_app_shutw_applet(struct stconn *sc);
+static void sc_app_shut_applet(struct stconn *sc);
static void sc_app_chk_rcv_applet(struct stconn *sc);
static void sc_app_chk_snd_applet(struct stconn *sc);
.chk_rcv = sc_app_chk_rcv_conn,
.chk_snd = sc_app_chk_snd_conn,
.abort = sc_app_abort_conn,
- .shutw = sc_app_shutw_conn,
+ .shutdown= sc_app_shut_conn,
.wake = sc_conn_process,
.name = "STRM",
};
.chk_rcv = sc_app_chk_rcv,
.chk_snd = sc_app_chk_snd,
.abort = sc_app_abort,
- .shutw = sc_app_shutw,
+ .shutdown= sc_app_shut,
.wake = NULL, /* may never be used */
.name = "NONE", /* may never be used */
};
.chk_rcv = sc_app_chk_rcv_applet,
.chk_snd = sc_app_chk_snd_applet,
.abort = sc_app_abort_applet,
- .shutw = sc_app_shutw_applet,
+ .shutdown= sc_app_shut_applet,
.wake = sc_applet_process,
.name = "STRM",
};
.chk_rcv = NULL,
.chk_snd = NULL,
.abort = NULL,
- .shutw = NULL,
+ .shutdown= NULL,
.wake = wake_srv_chk,
.name = "CHCK",
};
* side. Otherwise, 0 is returned. In this case, SC_FL_SHUT_WANTED flag may be set on
* the consumer SC if we are only waiting for the outgoing data to be flushed.
*/
-static inline int sc_cond_forward_shutw(struct stconn *sc)
+static inline int sc_cond_forward_shut(struct stconn *sc)
{
/* The close must not be forwarded */
if (!(sc->flags & SC_FL_ABRT_DONE) || !(sc->flags & SC_FL_NOHALF))
if (sc->flags & SC_FL_ISBACK)
__sc_strm(sc)->conn_exp = TICK_ETERNITY;
}
- else if (sc_cond_forward_shutw(sc))
- return sc_app_shutw(sc);
+ else if (sc_cond_forward_shut(sc))
+ return sc_app_shut(sc);
/* note that if the task exists, it must unregister itself once it runs */
if (!(sc->flags & SC_FL_DONT_WAKE))
* reflect the new state. It does also close everything if the SC was marked as
* being in error state. The owner task is woken up if it exists.
*/
-static void sc_app_shutw(struct stconn *sc)
+static void sc_app_shut(struct stconn *sc)
{
struct channel *ic = sc_ic(sc);
struct channel *oc = sc_oc(sc);
if (sc->flags & SC_FL_ISBACK)
__sc_strm(sc)->conn_exp = TICK_ETERNITY;
}
- else if (sc_cond_forward_shutw(sc))
- return sc_app_shutw_conn(sc);
+ else if (sc_cond_forward_shut(sc))
+ return sc_app_shut_conn(sc);
}
/*
* everything if the SC was marked as being in error state. If there is a
* data-layer shutdown, it is called.
*/
-static void sc_app_shutw_conn(struct stconn *sc)
+static void sc_app_shut_conn(struct stconn *sc)
{
struct channel *ic = sc_ic(sc);
struct channel *oc = sc_oc(sc);
if ((oc->flags & CF_AUTO_CLOSE) &&
((sc->flags & (SC_FL_SHUT_DONE|SC_FL_SHUT_WANTED)) == SC_FL_SHUT_WANTED) &&
sc_state_in(sc->state, SC_SB_RDY|SC_SB_EST)) {
- sc_shutw(sc);
+ sc_shutdown(sc);
goto out_wakeup;
}
if (sc->flags & SC_FL_ISBACK)
__sc_strm(sc)->conn_exp = TICK_ETERNITY;
}
- else if (sc_cond_forward_shutw(sc))
- return sc_app_shutw_applet(sc);
+ else if (sc_cond_forward_shut(sc))
+ return sc_app_shut_applet(sc);
}
/*
* updated to reflect the new state. It does also close everything if the SI
* was marked as being in error state. The owner task is woken up if it exists.
*/
-static void sc_app_shutw_applet(struct stconn *sc)
+static void sc_app_shut_applet(struct stconn *sc)
{
struct channel *ic = sc_ic(sc);
struct channel *oc = sc_oc(sc);
if (((sc->flags & (SC_FL_SHUT_DONE|SC_FL_SHUT_WANTED)) == SC_FL_SHUT_WANTED) &&
(sc->state == SC_ST_EST) && (!conn || !(conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS))))
- sc_shutw(sc);
+ sc_shutdown(sc);
}
/* indicate that we may be waiting for data from the output channel or
if (sc->flags & SC_FL_SHUT_DONE)
goto do_close;
- if (sc_cond_forward_shutw(sc)) {
+ if (sc_cond_forward_shut(sc)) {
/* we want to immediately forward this close to the write side */
/* force flag on ssl to keep stream in cache */
sc_conn_shutw(sc, CO_SHW_SILENT);
if (unlikely(!(s->scb->flags & SC_FL_SHUT_DONE) && (s->req.flags & CF_WRITE_TIMEOUT))) {
s->scb->flags |= SC_FL_NOLINGER;
- sc_shutw(s->scb);
+ sc_shutdown(s->scb);
}
if (unlikely(!(s->scf->flags & SC_FL_ABRT_DONE) && (s->req.flags & CF_READ_TIMEOUT))) {
}
if (unlikely(!(s->scf->flags & SC_FL_SHUT_DONE) && (s->res.flags & CF_WRITE_TIMEOUT))) {
s->scf->flags |= SC_FL_NOLINGER;
- sc_shutw(s->scf);
+ sc_shutdown(s->scf);
}
if (unlikely(!(s->scb->flags & SC_FL_ABRT_DONE) && (s->res.flags & CF_READ_TIMEOUT))) {
if (unlikely(sc_ep_test(scf, SE_FL_ERROR))) {
if (sc_state_in(scf->state, SC_SB_EST|SC_SB_DIS)) {
sc_abort(scf);
- sc_shutw(scf);
+ sc_shutdown(scf);
//sc_report_error(scf); TODO: Be sure it is useless
if (!(req->analysers) && !(res->analysers)) {
_HA_ATOMIC_INC(&s->be->be_counters.cli_aborts);
if (unlikely(sc_ep_test(scb, SE_FL_ERROR))) {
if (sc_state_in(scb->state, SC_SB_EST|SC_SB_DIS)) {
sc_abort(scb);
- sc_shutw(scb);
+ sc_shutdown(scb);
//sc_report_error(scb); TODO: Be sure it is useless
_HA_ATOMIC_INC(&s->be->be_counters.failed_resp);
if (srv)
channel_is_empty(req))) {
if (sc_ep_test(s->scf, SE_FL_ERROR))
scb->flags |= SC_FL_NOLINGER;
- sc_shutw(scb);
+ sc_shutdown(scb);
}
/* shutdown(write) done on server side, we must stop the client too */
/* shutdown(write) pending */
if (unlikely((scf->flags & (SC_FL_SHUT_DONE|SC_FL_SHUT_WANTED)) == SC_FL_SHUT_WANTED &&
channel_is_empty(res))) {
- sc_shutw(scf);
+ sc_shutdown(scf);
}
/* shutdown(write) done on the client side, we must stop the server too */