diff --git a/src/cache.c b/src/cache.c index acd68722b..12609e1ac 100644 --- a/src/cache.c +++ b/src/cache.c @@ -620,8 +620,7 @@ cache_store_http_payload(struct stream *s, struct filter *filter, struct http_ms case HTX_BLK_DATA: v = htx_get_blk_value(htx, blk); - v.ptr += offset; - v.len -= offset; + v = istadv(v, offset); if (v.len > len) v.len = len; diff --git a/src/flt_trace.c b/src/flt_trace.c index 206beda59..424cd0014 100644 --- a/src/flt_trace.c +++ b/src/flt_trace.c @@ -143,8 +143,7 @@ trace_htx_hexdump(struct htx *htx, unsigned int offset, unsigned int len) } v = htx_get_blk_value(htx, blk); - v.ptr += offset; - v.len -= offset; + v = istadv(v, offset); offset = 0; if (v.len > len) diff --git a/src/htx.c b/src/htx.c index 6a4fe2d35..774727b53 100644 --- a/src/htx.c +++ b/src/htx.c @@ -543,8 +543,7 @@ struct htx_blk *htx_add_data_atonce(struct htx *htx, struct ist data) blk = tailblk; goto end; } - data.ptr += len; - data.len -= len; + data = istadv(data, len); add_new_block: /* FIXME: check data.len (< 256MB) */ diff --git a/src/mux_h2.c b/src/mux_h2.c index 3810943c5..46940b404 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -5361,16 +5361,14 @@ static size_t h2s_bck_make_req_headers(struct h2s *h2s, struct htx *htx) if (len + 2 < uri.len && uri.ptr[len + 1] == '/' && uri.ptr[len + 2] == '/') { /* make the uri start at the authority now */ scheme = ist2(uri.ptr, len); - uri.ptr += len + 3; - uri.len -= len + 3; + uri = istadv(uri, len + 3); /* find the auth part of the URI */ auth = ist2(uri.ptr, 0); while (auth.len < uri.len && auth.ptr[auth.len] != '/') auth.len++; - uri.ptr += auth.len; - uri.len -= auth.len; + uri = istadv(uri, auth.len); } }