MINOR: stream-int/conn-stream: Move half-close timeout in the conn-stream

The half-close timeout (hcto) is now part of the conn-stream. It is a step
closer to the stream-interface removal.
This commit is contained in:
Christopher Faulet 2022-03-29 18:03:35 +02:00
parent 8da67aae3e
commit 1d9877700e
7 changed files with 12 additions and 11 deletions

View File

@ -124,6 +124,7 @@ struct conn_stream {
enum obj_type obj_type; /* differentiates connection from applet context */
/* 3 bytes hole here */
unsigned int flags; /* CS_FL_* */
unsigned int hcto; /* half-closed timeout (0 = unset) */
struct cs_endpoint *endp; /* points to the end point (MUX stream or appctx) */
enum obj_type *app; /* points to the applicative point (stream or check) */
struct stream_interface *si;

View File

@ -130,7 +130,6 @@ struct stream_interface {
/* struct members below are the "remote" part, as seen from the buffer side */
unsigned int err_type; /* first error detected, one of SI_ET_* */
unsigned int hcto; /* half-closed timeout (0 = unset) */
struct wait_event wait_event; /* We're in a wait list */
};

View File

@ -2822,7 +2822,7 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
s->res.rex = TICK_ETERNITY;
s->res.wex = TICK_ETERNITY;
s->res.analyse_exp = TICK_ETERNITY;
cs_si(s->csb)->hcto = TICK_ETERNITY;
s->csb->hcto = TICK_ETERNITY;
/* we're removing the analysers, we MUST re-enable events detection.
* We don't enable close on the response channel since it's either

View File

@ -57,6 +57,7 @@ struct conn_stream *cs_new(struct cs_endpoint *endp)
cs->obj_type = OBJ_TYPE_CS;
cs->flags = CS_FL_NONE;
cs->hcto = TICK_ETERNITY;
cs->app = NULL;
cs->si = NULL;
cs->data_cb = NULL;

View File

@ -2310,7 +2310,7 @@ int stream_set_backend(struct stream *s, struct proxy *be)
cs_si(s->csb)->flags |= SI_FL_INDEP_STR;
if (tick_isset(be->timeout.serverfin))
cs_si(s->csb)->hcto = be->timeout.serverfin;
s->csb->hcto = be->timeout.serverfin;
/* We want to enable the backend-specific analysers except those which
* were already run as part of the frontend/listener. Note that it would

View File

@ -454,13 +454,13 @@ struct stream *stream_new(struct session *sess, struct conn_stream *cs, struct b
goto out_fail_alloc_csb;
si_set_state(cs_si(s->csf), SI_ST_EST);
cs_si(s->csf)->hcto = sess->fe->timeout.clientfin;
s->csf->hcto = sess->fe->timeout.clientfin;
if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
cs_si(s->csf)->flags |= SI_FL_INDEP_STR;
cs_si(s->csb)->flags = SI_FL_ISBACK;
cs_si(s->csb)->hcto = TICK_ETERNITY;
s->csb->hcto = TICK_ETERNITY;
if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
cs_si(s->csb)->flags |= SI_FL_INDEP_STR;

View File

@ -237,8 +237,8 @@ static void stream_int_shutw(struct stream_interface *si)
oc->wex = TICK_ETERNITY;
si_done_get(si);
if (tick_isset(si->hcto)) {
ic->rto = si->hcto;
if (tick_isset(si->cs->hcto)) {
ic->rto = si->cs->hcto;
ic->rex = tick_add(now_ms, ic->rto);
}
@ -1106,8 +1106,8 @@ static void stream_int_shutw_conn(struct stream_interface *si)
oc->wex = TICK_ETERNITY;
si_done_get(si);
if (tick_isset(si->hcto)) {
ic->rto = si->hcto;
if (tick_isset(si->cs->hcto)) {
ic->rto = si->cs->hcto;
ic->rex = tick_add(now_ms, ic->rto);
}
@ -1756,8 +1756,8 @@ static void stream_int_shutw_applet(struct stream_interface *si)
oc->wex = TICK_ETERNITY;
si_done_get(si);
if (tick_isset(si->hcto)) {
ic->rto = si->hcto;
if (tick_isset(si->cs->hcto)) {
ic->rto = si->cs->hcto;
ic->rex = tick_add(now_ms, ic->rto);
}