Files
LeencyandBurer 8a48f089d8
Build system / Build (en_US) (push) Successful in 2m25s
Build system / Build (ru_RU) (push) Successful in 2m27s
Build system / Build (es_ES) (push) Successful in 2m30s
Build system / Publish Images (push) Successful in 2m46s
libs/http.obj: fix content_received overcount on chunked transfers (#569)
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>
2026-07-21 10:02:50 +00:00
..
2016-11-10 19:28:16 +00:00
2016-11-10 19:27:40 +00:00
2015-12-31 11:42:32 +00:00
2024-05-29 11:30:32 +00:00
2021-05-22 19:09:11 +00:00
2024-05-21 14:45:21 +00:00
2024-05-21 14:45:21 +00:00
2024-05-21 14:45:21 +00:00