For chunked responses HTTP_receive added the whole buffer tail to content_received every time it consumed a chunkline. When several chunks arrived in one TCP segment, the same bytes were counted once per chunkline (observed: content_received = 42 MB for an 83 KB page); the value only became exact at got_all_data. A client trusting the counter mid-transfer read far past the buffer and page-faulted. In plain buffered mode recompute the exact value from the pointers instead: min(chunk_ptr, write_ptr) - content_ptr, the same formula .got_all_data_chunked uses. Data below chunk_ptr is decoded and contiguous; bytes in [chunk_ptr, write_ptr) are still raw (unconsumed chunkline + partial chunk). Stream/ring modes keep the running add: there data is consumed as it arrives, so the incremental count is correct. --------- Co-authored-by: Burer <burer@kolibrios.org> Reviewed-on: #569 Reviewed-by: hidnplayr <hidnplayr@gmail.com> Reviewed-by: Burer <burer@kolibrios.org> Co-authored-by: leency <lipatov.kiril@gmail.com>