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.
diff --git a/include/haproxy/conn_stream-t.h b/include/haproxy/conn_stream-t.h
index fdaa6c3..55f338b 100644
--- a/include/haproxy/conn_stream-t.h
+++ b/include/haproxy/conn_stream-t.h
@@ -124,6 +124,7 @@
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;
diff --git a/include/haproxy/stream_interface-t.h b/include/haproxy/stream_interface-t.h
index d9f1242..d01cea2 100644
--- a/include/haproxy/stream_interface-t.h
+++ b/include/haproxy/stream_interface-t.h
@@ -130,7 +130,6 @@
/* 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 */
};
diff --git a/src/cli.c b/src/cli.c
index 9b53370..a1ab7e2 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -2822,7 +2822,7 @@
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
diff --git a/src/conn_stream.c b/src/conn_stream.c
index 55dd86c..e5a3ad7 100644
--- a/src/conn_stream.c
+++ b/src/conn_stream.c
@@ -57,6 +57,7 @@
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;
diff --git a/src/proxy.c b/src/proxy.c
index 5024178..70710d0 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -2310,7 +2310,7 @@
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
diff --git a/src/stream.c b/src/stream.c
index 200f69e..eceea2e 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -454,13 +454,13 @@
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;
diff --git a/src/stream_interface.c b/src/stream_interface.c
index b4d7cab..9be918b 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -237,8 +237,8 @@
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 @@
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 @@
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);
}