From be5cc766b0184747c1578eabd4fbee04d7d26222 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 20 Feb 2023 08:41:55 +0100 Subject: [PATCH] MINOR: stconn: Remove half-closed timeout The half-closed timeout is now directly retrieved from the proxy settings. There is no longer usage for the .hcto field in the stconn structure. So let's remove it. --- include/haproxy/stconn-t.h | 1 - src/cli.c | 2 -- src/proxy.c | 3 --- src/stconn.c | 2 +- src/stream.c | 2 -- 5 files changed, 1 insertion(+), 9 deletions(-) diff --git a/include/haproxy/stconn-t.h b/include/haproxy/stconn-t.h index 019533b0b..8baf965ac 100644 --- a/include/haproxy/stconn-t.h +++ b/include/haproxy/stconn-t.h @@ -241,7 +241,6 @@ struct stconn { /* 2 bytes hole here */ unsigned int flags; /* SC_FL_* */ - unsigned int hcto; /* half-closed timeout (0 = unset) */ unsigned int ioto; /* I/O activity timeout */ struct wait_event wait_event; /* We're in a wait list */ struct sedesc *sedesc; /* points to the stream endpoint descriptor */ diff --git a/src/cli.c b/src/cli.c index af45c27d2..cf39cb680 100644 --- a/src/cli.c +++ b/src/cli.c @@ -2830,8 +2830,6 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit) s->req.analyse_exp = TICK_ETERNITY; s->res.analyse_exp = TICK_ETERNITY; - s->scb->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 * already closed, or in keep-alive with an idle connection handler. diff --git a/src/proxy.c b/src/proxy.c index a021224d6..404037d80 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -2404,9 +2404,6 @@ int stream_set_backend(struct stream *s, struct proxy *be) if (be->options2 & PR_O2_INDEPSTR) s->scb->flags |= SC_FL_INDEP_STR; - if (tick_isset(be->timeout.serverfin)) - s->scb->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 * be more reliable to store the list of analysers that have been run, diff --git a/src/stconn.c b/src/stconn.c index 6cf4830ce..3c19cfc38 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -135,7 +135,7 @@ static struct stconn *sc_new(struct sedesc *sedesc) sc->obj_type = OBJ_TYPE_SC; sc->flags = SC_FL_NONE; sc->state = SC_ST_INI; - sc->ioto = sc->hcto = TICK_ETERNITY; + sc->ioto = TICK_ETERNITY; sc->app = NULL; sc->app_ops = NULL; sc->src = NULL; diff --git a/src/stream.c b/src/stream.c index 533c3ee9b..28bb98668 100644 --- a/src/stream.c +++ b/src/stream.c @@ -478,12 +478,10 @@ struct stream *stream_new(struct session *sess, struct stconn *sc, struct buffer goto out_fail_alloc_scb; sc_set_state(s->scf, SC_ST_EST); - s->scf->hcto = sess->fe->timeout.clientfin; if (likely(sess->fe->options2 & PR_O2_INDEPSTR)) s->scf->flags |= SC_FL_INDEP_STR; - s->scb->hcto = TICK_ETERNITY; if (likely(sess->fe->options2 & PR_O2_INDEPSTR)) s->scb->flags |= SC_FL_INDEP_STR;