MINOR: h1-htx: Update h1 parsing functions to return result as a size_t
h1 parsing functions (h1_parse_msg_*) returns the number of bytes parsed or
0 if nothing is parsed because an error occurred or some data are
missing. But they never return negative values. Thus, instead of a signed
integer, these function now return a size_t value.
The H1 and FCGI muxes are updated accordingly. Note that h1_parse_msg_data()
has been slightly adapted because the parsing of chunked messages still need
to handle negative values when a parsing error is reported by
h1_parse_chunk_size() or h1_skip_chunk_crlf().
diff --git a/src/mux_h1.c b/src/mux_h1.c
index af02478..0b75dbb 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -1376,7 +1376,7 @@
struct buffer *buf, size_t *ofs, size_t max)
{
union h1_sl h1sl;
- int ret = 0;
+ size_t ret = 0;
TRACE_ENTER(H1_EV_RX_DATA|H1_EV_RX_HDRS, h1s->h1c->conn, h1s, 0, (size_t[]){max});
@@ -1446,7 +1446,7 @@
struct buffer *buf, size_t *ofs, size_t max,
struct buffer *htxbuf)
{
- int ret;
+ size_t ret;
TRACE_ENTER(H1_EV_RX_DATA|H1_EV_RX_BODY, h1s->h1c->conn, h1s, 0, (size_t[]){max});
ret = h1_parse_msg_data(h1m, htx, buf, *ofs, max, htxbuf);
@@ -1476,7 +1476,7 @@
static size_t h1_process_trailers(struct h1s *h1s, struct h1m *h1m, struct htx *htx,
struct buffer *buf, size_t *ofs, size_t max)
{
- int ret;
+ size_t ret;
TRACE_ENTER(H1_EV_RX_DATA|H1_EV_RX_TLRS, h1s->h1c->conn, h1s, 0, (size_t[]){max});
ret = h1_parse_msg_tlrs(h1m, htx, buf, *ofs, max);