From c85994d53b51a8db983d91ca8a6bf686eeb367e6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 19 Dec 2025 14:21:19 +0100 Subject: [PATCH] http: minor cleanup after the unfold rework Closes #20037 --- lib/http.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/lib/http.c b/lib/http.c index afecdbbce3..94c22bbc8b 100644 --- a/lib/http.c +++ b/lib/http.c @@ -4398,22 +4398,15 @@ static CURLcode http_parse_headers(struct Curl_easy *data, goto out; /* read more and try again */ } - /* the size of the remaining (supposed) header line */ + /* the size of the remaining header line */ consumed = (end_ptr - buf) + 1; - { - /* preserve the whole original header piece size */ - size_t header_piece = consumed; - - if(consumed) { - result = curlx_dyn_addn(&data->state.headerb, buf, consumed); - if(result) - return result; - blen -= consumed; - buf += consumed; - } - *pconsumed += header_piece + unfold_len; - } + result = curlx_dyn_addn(&data->state.headerb, buf, consumed); + if(result) + return result; + blen -= consumed; + buf += consumed; + *pconsumed += consumed + unfold_len; /**** * We now have a FULL header line in 'headerb'.