diff --git a/include/haproxy/htx-t.h b/include/haproxy/htx-t.h index e49b0ee86..00703412d 100644 --- a/include/haproxy/htx-t.h +++ b/include/haproxy/htx-t.h @@ -187,10 +187,6 @@ struct htx_sl { /* XXX 2 bytes unused */ - int32_t hdrs_bytes; /* Bytes held by all headers, as seen by the mux - * during parsing, from this start-line to the - * corresponding EOH. -1 if unknown */ - unsigned int len[3]; /* length of different parts of the start-line */ char l[VAR_ARRAY]; }; diff --git a/include/haproxy/htx.h b/include/haproxy/htx.h index 242397cbb..ce6b7853f 100644 --- a/include/haproxy/htx.h +++ b/include/haproxy/htx.h @@ -446,7 +446,6 @@ static inline struct htx_sl *htx_add_stline(struct htx *htx, enum htx_blk_type t blk->info += size; sl = htx_get_blk_ptr(htx, blk); - sl->hdrs_bytes = -1; sl->flags = flags; HTX_SL_P1_LEN(sl) = p1.len; diff --git a/src/h1_htx.c b/src/h1_htx.c index 136bf461e..dfc6b89c9 100644 --- a/src/h1_htx.c +++ b/src/h1_htx.c @@ -152,7 +152,6 @@ static int h1_postparse_req_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx struct htx_sl *sl; struct ist meth, uri, vsn; unsigned int flags; - size_t used; /* is always defined for a request */ meth = h1sl->rq.m; @@ -178,7 +177,6 @@ static int h1_postparse_req_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx h1m->curr_len = h1m->body_len = 0; } - used = htx_used_space(htx); flags = h1m_htx_sl_flags(h1m); sl = htx_add_stline(htx, HTX_BLK_REQ_SL, flags, meth, uri, vsn); if (!sl || !htx_add_all_headers(htx, hdrs)) @@ -194,8 +192,6 @@ static int h1_postparse_req_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx if (uri.len > 4 && (uri.ptr[0] | 0x20) == 'h') sl->flags |= ((uri.ptr[4] == ':') ? HTX_SL_F_SCHM_HTTP : HTX_SL_F_SCHM_HTTPS); } - /* Set bytes used in the HTX message for the headers now */ - sl->hdrs_bytes = htx_used_space(htx) - used; /* If body length cannot be determined, set htx->extra to * ULLONG_MAX. This value is impossible in other cases. @@ -222,7 +218,6 @@ static int h1_postparse_res_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx struct htx_sl *sl; struct ist vsn, status, reason; unsigned int flags; - size_t used; uint16_t code = 0; if (h1sl) { @@ -285,16 +280,12 @@ static int h1_postparse_res_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx h1m->flags |= H1_MF_XFER_LEN; } - used = htx_used_space(htx); flags = h1m_htx_sl_flags(h1m); sl = htx_add_stline(htx, HTX_BLK_RES_SL, flags, vsn, status, reason); if (!sl || !htx_add_all_headers(htx, hdrs)) goto error; sl->info.res.status = code; - /* Set bytes used in the HTX message for the headers now */ - sl->hdrs_bytes = htx_used_space(htx) - used; - /* If body length cannot be determined, set htx->extra to * ULLONG_MAX. This value is impossible in other cases. */ diff --git a/src/h2.c b/src/h2.c index 9ff3c938e..27a7a4e90 100644 --- a/src/h2.c +++ b/src/h2.c @@ -369,7 +369,6 @@ int h2_make_htx_request(struct http_hdr *list, struct htx *htx, unsigned int *ms int phdr; int ret; int i; - uint32_t used = htx_used_space(htx); struct htx_sl *sl = NULL; unsigned int sl_flags = 0; const char *ctl; @@ -554,9 +553,6 @@ int h2_make_htx_request(struct http_hdr *list, struct htx *htx, unsigned int *ms if (!htx_add_endof(htx, HTX_BLK_EOH)) goto fail; - /* Set bytes used in the HTX message for the headers now */ - sl->hdrs_bytes = htx_used_space(htx) - used; - ret = 1; return ret; @@ -670,7 +666,6 @@ int h2_make_htx_response(struct http_hdr *list, struct htx *htx, unsigned int *m int phdr; int ret; int i; - uint32_t used = htx_used_space(htx); struct htx_sl *sl = NULL; unsigned int sl_flags = 0; const char *ctl; @@ -801,9 +796,6 @@ int h2_make_htx_response(struct http_hdr *list, struct htx *htx, unsigned int *m if (!htx_add_endof(htx, HTX_BLK_EOH)) goto fail; - /* Set bytes used in the HTX message for the headers now */ - sl->hdrs_bytes = htx_used_space(htx) - used; - ret = 1; return ret; diff --git a/src/htx.c b/src/htx.c index 53646b903..28b2c47b6 100644 --- a/src/htx.c +++ b/src/htx.c @@ -808,7 +808,6 @@ struct htx_sl *htx_replace_stline(struct htx *htx, struct htx_blk *blk, const st sl = htx_get_blk_ptr(htx, blk); tmp.info = sl->info; tmp.flags = sl->flags; - tmp.hdrs_bytes = sl->hdrs_bytes; sz = htx_get_blksz(blk); delta = sizeof(*sl) + p1.len + p2.len + p3.len - sz; @@ -829,7 +828,6 @@ struct htx_sl *htx_replace_stline(struct htx *htx, struct htx_blk *blk, const st sl = htx_get_blk_ptr(htx, blk); sl->info = tmp.info; sl->flags = tmp.flags; - sl->hdrs_bytes = tmp.hdrs_bytes; HTX_SL_P1_LEN(sl) = p1.len; HTX_SL_P2_LEN(sl) = p2.len;