CLEANUP: htx: Remove unsued hdrs_bytes field from the HTX start-line
Thanks to the htx_xfer_blks() refactoring, it is now possible to remove
hdrs_bytes field from the start-line because no function rely on it anymore.
diff --git a/include/haproxy/htx-t.h b/include/haproxy/htx-t.h
index e49b0ee..0070341 100644
--- a/include/haproxy/htx-t.h
+++ b/include/haproxy/htx-t.h
@@ -187,10 +187,6 @@
/* 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 242397c..ce6b785 100644
--- a/include/haproxy/htx.h
+++ b/include/haproxy/htx.h
@@ -446,7 +446,6 @@
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 136bf46..dfc6b89 100644
--- a/src/h1_htx.c
+++ b/src/h1_htx.c
@@ -152,7 +152,6 @@
struct htx_sl *sl;
struct ist meth, uri, vsn;
unsigned int flags;
- size_t used;
/* <h1sl> is always defined for a request */
meth = h1sl->rq.m;
@@ -178,7 +177,6 @@
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 @@
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 @@
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 @@
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 9ff3c93..27a7a4e 100644
--- a/src/h2.c
+++ b/src/h2.c
@@ -369,7 +369,6 @@
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 @@
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 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 @@
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 53646b9..28b2c47 100644
--- a/src/htx.c
+++ b/src/htx.c
@@ -808,7 +808,6 @@
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 @@
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;