diff --git a/include/haproxy/htx-t.h b/include/haproxy/htx-t.h index a33da886e..eecd0abad 100644 --- a/include/haproxy/htx-t.h +++ b/include/haproxy/htx-t.h @@ -177,7 +177,7 @@ static forceinline char *hsl_show_flags(char *buf, size_t len, const char *delim #define HTX_FL_PARSING_ERROR 0x00000001 /* Set when a parsing error occurred */ #define HTX_FL_PROCESSING_ERROR 0x00000002 /* Set when a processing error occurred */ #define HTX_FL_FRAGMENTED 0x00000004 /* Set when the HTX buffer is fragmented */ -#define HTX_FL_ALTERED_PAYLOAD 0x00000008 /* The payload is altered, the extra value must not be trusted */ +/* 0x00000008 unused */ #define HTX_FL_EOM 0x00000010 /* Set when end-of-message is reached from the HTTP point of view * (at worst, on the EOM block is missing) */ @@ -265,7 +265,6 @@ struct htx { uint32_t head_addr; /* start address of the free space at the beginning */ uint32_t end_addr; /* end address of the free space at the beginning */ - uint64_t extra; /* known bytes amount remaining to receive */ uint32_t flags; /* HTX_FL_* */ /* XXX 4 bytes unused */ diff --git a/include/haproxy/htx.h b/include/haproxy/htx.h index 47893ef1d..aa2aaf5e8 100644 --- a/include/haproxy/htx.h +++ b/include/haproxy/htx.h @@ -30,11 +30,6 @@ #include #include -/* ->extra field value when the payload length is unknown (non-chunked message - * with no "Content-length" header) - */ -#define HTX_UNKOWN_PAYLOAD_LENGTH ULLONG_MAX - extern struct htx htx_empty; struct htx_blk *htx_defrag(struct htx *htx, struct htx_blk *blk, uint32_t info); @@ -660,7 +655,6 @@ static inline void htx_reset(struct htx *htx) htx->tail = htx->head = htx->first = -1; htx->data = 0; htx->tail_addr = htx->head_addr = htx->end_addr = 0; - htx->extra = 0; htx->flags = HTX_FL_NONE; } @@ -700,8 +694,6 @@ static inline struct htx *htxbuf(const struct buffer *buf) htx->size = buf->size - sizeof(*htx); htx_reset(htx); } - if (htx->flags & HTX_FL_ALTERED_PAYLOAD) - htx->extra = 0; return htx; } @@ -837,10 +829,10 @@ static inline void htx_dump(struct buffer *chunk, const struct htx *htx, int ful { int32_t pos; - chunk_appendf(chunk, " htx=%p(size=%u,data=%u,used=%u,wrap=%s,flags=0x%08x,extra=%llu," + chunk_appendf(chunk, " htx=%p(size=%u,data=%u,used=%u,wrap=%s,flags=0x%08x," "first=%d,head=%d,tail=%d,tail_addr=%d,head_addr=%d,end_addr=%d)", htx, htx->size, htx->data, htx_nbblks(htx), (!htx->head_addr) ? "NO" : "YES", - htx->flags, (unsigned long long)htx->extra, htx->first, htx->head, htx->tail, + htx->flags, htx->first, htx->head, htx->tail, htx->tail_addr, htx->head_addr, htx->end_addr); if (!full || !htx_nbblks(htx)) diff --git a/src/applet.c b/src/applet.c index edea10290..c7d5b4b41 100644 --- a/src/applet.c +++ b/src/applet.c @@ -517,7 +517,6 @@ size_t appctx_htx_rcv_buf(struct appctx *appctx, struct buffer *buf, size_t coun if (htx_is_empty(appctx_htx)) { buf_htx->flags |= (appctx_htx->flags & HTX_FL_EOM); } - buf_htx->extra = (appctx_htx->extra ? (appctx_htx->data + appctx_htx->extra) : 0); htx_to_buf(buf_htx, buf); htx_to_buf(appctx_htx, &appctx->outbuf); ret -= appctx_htx->data; @@ -605,7 +604,6 @@ size_t appctx_htx_snd_buf(struct appctx *appctx, struct buffer *buf, size_t coun appctx_htx->flags |= (buf_htx->flags & HTX_FL_EOM); } - appctx_htx->extra = (buf_htx->extra ? (buf_htx->data + buf_htx->extra) : 0); htx_to_buf(appctx_htx, &appctx->outbuf); htx_to_buf(buf_htx, buf); ret -= buf_htx->data; diff --git a/src/filters.c b/src/filters.c index d786292d3..3288e9afb 100644 --- a/src/filters.c +++ b/src/filters.c @@ -684,7 +684,6 @@ int flt_http_payload(struct stream *s, struct http_msg *msg, unsigned int len) { struct filter *filter; - struct htx *htx; unsigned long long *strm_off = &FLT_STRM_OFF(s, msg->chn); unsigned int out = co_data(msg->chn); int ret, data; @@ -734,10 +733,6 @@ flt_http_payload(struct stream *s, struct http_msg *msg, unsigned int len) ret = data; *strm_off += ret; end: - htx = htxbuf(&msg->chn->buf); - htx->flags |= HTX_FL_ALTERED_PAYLOAD; - if (msg->flags & HTTP_MSGF_XFER_LEN) - htx->extra = 0; chn_prod(msg->chn)->sedesc->kip = 0; DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_FLT_ANA, s); return ret; diff --git a/src/h1_htx.c b/src/h1_htx.c index 4da1896c3..8c8723dad 100644 --- a/src/h1_htx.c +++ b/src/h1_htx.c @@ -226,11 +226,6 @@ static int h1_postparse_req_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx http_scheme_based_normalize(htx); } - /* If body length cannot be determined, set htx->extra to - * HTX_UNKOWN_PAYLOAD_LENGTH. This value is impossible in other cases. - */ - htx->extra = ((h1m->flags & H1_MF_XFER_LEN) ? h1m->curr_len : HTX_UNKOWN_PAYLOAD_LENGTH); - end: return 1; output_full: @@ -351,11 +346,6 @@ static int h1_postparse_res_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx goto error; sl->info.res.status = code; - /* If body length cannot be determined, set htx->extra to - * HTX_UNKOWN_PAYLOAD_LENGTH. This value is impossible in other cases. - */ - htx->extra = ((h1m->flags & H1_MF_XFER_LEN) ? h1m->curr_len : HTX_UNKOWN_PAYLOAD_LENGTH); - end: return 1; output_full: @@ -611,8 +601,6 @@ static size_t h1_parse_chunk(struct h1m *h1m, struct htx **dsthtx, total = 0; } - /* Don't forget to update htx->extra */ - (*dsthtx)->extra = h1m->curr_len; *max = lmax; return total; } @@ -765,7 +753,6 @@ static size_t h1_parse_full_contig_chunks(struct h1m *h1m, struct htx **dsthtx, h1m->curr_len = chksz; h1m->body_len += chksz; h1m->state = H1_MSG_DATA; - (*dsthtx)->extra = h1m->curr_len; save = ridx; goto end_parsing; } @@ -885,7 +872,6 @@ size_t h1_parse_msg_data(struct h1m *h1m, struct htx **dsthtx, sz = h1m->curr_len; sz = h1_copy_msg_data(dsthtx, srcbuf, ofs, sz, max, htxbuf); h1m->curr_len -= sz; - (*dsthtx)->extra = h1m->curr_len; total += sz; if (!h1m->curr_len) { h1m->state = H1_MSG_DONE; diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index bbec51f3a..f287f6a7e 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -3571,7 +3571,6 @@ static size_t fcgi_strm_parse_response(struct fcgi_strm *fstrm, struct buffer *b break; sl = htx_get_blk_ptr(htx, blk); sl->flags |= HTX_SL_F_XFER_LEN; - htx->extra = 0; } } else if (h1m->state < H1_MSG_TRAILERS) { diff --git a/src/mux_h2.c b/src/mux_h2.c index f6196db55..406a953bd 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -6146,7 +6146,6 @@ next_frame: /* a payload is present */ if (msgf & H2_MSGF_BODY_CL) { *flags |= H2_SF_DATA_CLEN; - htx->extra = *body_len; } } if (msgf & H2_MSGF_BODYLESS_RSP) @@ -6327,11 +6326,7 @@ try_again: h2c->dfl -= sent; h2c->rcvd_c += sent; h2c->rcvd_s += sent; // warning, this can also affect the closed streams! - h2s->body_len -= sent; - if (h2s->flags & H2_SF_DATA_CLEN) - htx->extra = h2s->body_len; - if (sent < flen) { if (h2s_get_rxbuf(h2s)) @@ -7760,7 +7755,6 @@ static size_t h2_rcv_buf(struct stconn *sc, struct buffer *buf, size_t count, in buf_htx->flags |= (h2s_htx->flags & HTX_FL_EOM); } - buf_htx->extra = (h2s_htx->extra ? (h2s_htx->data + h2s_htx->extra) : 0); htx_to_buf(buf_htx, buf); htx_to_buf(h2s_htx, rxbuf); ret -= h2s_htx->data; diff --git a/src/qmux_http.c b/src/qmux_http.c index 552e16821..b5494ad29 100644 --- a/src/qmux_http.c +++ b/src/qmux_http.c @@ -54,7 +54,6 @@ size_t qcs_http_rcv_buf(struct qcs *qcs, struct buffer *buf, size_t count, *fin = 1; } - cs_htx->extra = qcs_htx->extra ? (qcs_htx->data + qcs_htx->extra) : 0; htx_to_buf(cs_htx, buf); htx_to_buf(qcs_htx, &qcs->rx.app_buf); ret -= qcs_htx->data; diff --git a/src/stream.c b/src/stream.c index 852d042e7..ccb3ecd4e 100644 --- a/src/stream.c +++ b/src/stream.c @@ -3690,10 +3690,9 @@ static void __strm_dump_to_buffer(struct buffer *buf, const struct show_sess_ctx struct htx *htx = htxbuf(&strm->req.buf); chunk_appendf(buf, - "%s htx=%p flags=0x%x size=%u data=%u used=%u wrap=%s extra=%llu\n", pfx, + "%s htx=%p flags=0x%x size=%u data=%u used=%u wrap=%s\n", pfx, htx, htx->flags, htx->size, htx->data, htx_nbblks(htx), - (htx->tail >= htx->head) ? "NO" : "YES", - (unsigned long long)htx->extra); + (htx->tail >= htx->head) ? "NO" : "YES"); } if (HAS_FILTERS(strm) && strm->strm_flt.current[0]) { const struct filter *flt = strm->strm_flt.current[0]; @@ -3723,10 +3722,9 @@ static void __strm_dump_to_buffer(struct buffer *buf, const struct show_sess_ctx struct htx *htx = htxbuf(&strm->res.buf); chunk_appendf(buf, - "%s htx=%p flags=0x%x size=%u data=%u used=%u wrap=%s extra=%llu\n", pfx, + "%s htx=%p flags=0x%x size=%u data=%u used=%u wrap=%s\n", pfx, htx, htx->flags, htx->size, htx->data, htx_nbblks(htx), - (htx->tail >= htx->head) ? "NO" : "YES", - (unsigned long long)htx->extra); + (htx->tail >= htx->head) ? "NO" : "YES"); } if (HAS_FILTERS(strm) && strm->strm_flt.current[1]) {