summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faulet <cfaulet@haproxy.com>2020-09-30 14:06:23 +0200
committerChristopher Faulet <cfaulet@haproxy.com>2020-11-20 13:01:26 +0100
commitb658cdba9dd070b7f3f6bc27d80901e73e26e8e3 (patch)
tree21a2ffaf7159d1a0f2f500519c216da8f5ae2fe2
parent9c3f708956454d260ecf39bc429061590496fbe6 (diff)
downloadhaproxy-b658cdba9dd070b7f3f6bc27d80901e73e26e8e3.tar.gz
MINOR: mux-h1: Don't provide anymore timing info using cs_info structure
The cs_info are now unused. The stream uses the session to get these info. So we can safely remove it from the mux-h1.
-rw-r--r--src/mux_h1.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 9f445ac71..124129997 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -99,7 +99,6 @@ struct h1c {
struct h1s {
struct h1c *h1c;
struct conn_stream *cs;
- struct cs_info csinfo; /* CS info, only used for client connections */
uint32_t flags; /* Connection flags: H1S_F_* */
struct wait_event *subs; /* Address of the wait_event the conn_stream associated is waiting on */
@@ -571,30 +570,10 @@ static struct h1s *h1s_create(struct h1c *h1c, struct conn_stream *cs, struct se
/* For frontend connections we should always have a session */
if (!sess)
h1s->sess = sess = h1c->conn->owner;
-
- /* Timers for subsequent sessions on the same HTTP 1.x connection
- * measure from `now`, not from the connection accept time */
- if (h1s->flags & H1S_F_NOT_FIRST) {
- h1s->csinfo.create_date = date;
- h1s->csinfo.tv_create = now;
- h1s->csinfo.t_handshake = 0;
- h1s->csinfo.t_idle = -1;
- }
- else {
- h1s->csinfo.create_date = sess->accept_date;
- h1s->csinfo.tv_create = sess->tv_accept;
- h1s->csinfo.t_handshake = sess->t_handshake;
- h1s->csinfo.t_idle = -1;
- }
}
else {
if (h1c->px->options2 & PR_O2_RSPBUG_OK)
h1s->res.err_pos = -1;
-
- h1s->csinfo.create_date = date;
- h1s->csinfo.tv_create = now;
- h1s->csinfo.t_handshake = 0;
- h1s->csinfo.t_idle = -1;
}
/* If a conn_stream already exists, attach it to this H1S. Otherwise we
@@ -646,15 +625,6 @@ static void h1s_destroy(struct h1s *h1s)
}
}
-static const struct cs_info *h1_get_cs_info(struct conn_stream *cs)
-{
- struct h1s *h1s = cs->ctx;
-
- if (h1s && !conn_is_back(cs->conn))
- return &h1s->csinfo;
- return NULL;
-}
-
/*
* Initialize the mux once it's attached. It is expected that conn->ctx points
* to the existing conn_stream (for outgoing connections or for incoming ones
@@ -2083,11 +2053,8 @@ static int h1_recv(struct h1c *h1c)
if (ret > 0) {
TRACE_DATA("data received", H1_EV_H1C_RECV, h1c->conn, 0, 0, (size_t[]){ret});
rcvd = 1;
- if (h1s && h1s->cs) {
+ if (h1s && h1s->cs)
h1s->cs->flags |= (CS_FL_READ_PARTIAL|CS_FL_RCV_MORE);
- if (h1s->csinfo.t_idle == -1)
- h1s->csinfo.t_idle = tv_ms_elapsed(&h1s->csinfo.tv_create, &now) - h1s->csinfo.t_handshake;
- }
}
if (ret > 0 || !h1_recv_allowed(h1c) || !buf_room_for_htx_data(&h1c->ibuf)) {
@@ -2213,8 +2180,6 @@ static int h1_process(struct h1c * h1c)
h1s = h1c->h1s;
}
- if (b_data(&h1c->ibuf) && h1s->csinfo.t_idle == -1)
- h1s->csinfo.t_idle = tv_ms_elapsed(&h1s->csinfo.tv_create, &now) - h1s->csinfo.t_handshake;
if (b_data(&h1c->ibuf) && h1s->sess->t_idle == -1)
h1s->sess->t_idle = tv_ms_elapsed(&h1s->sess->tv_accept, &now) - h1s->sess->t_handshake;
@@ -3167,7 +3132,6 @@ static const struct mux_ops mux_h1_ops = {
.wake = h1_wake,
.attach = h1_attach,
.get_first_cs = h1_get_first_cs,
- .get_cs_info = h1_get_cs_info,
.detach = h1_detach,
.destroy = h1_destroy,
.avail_streams = h1_avail_streams,