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>
KolibriOS
KolibriOS is a hobby operating system for x86-compatible computers, which is currently being developed by a small but passionate team of enthusiasts.
Its kernel, most drivers, and many programs are written entirely in FASM assembly language, making them very compact and lean on system resources.
Based on MenuetOS, it uses its own standards and is NOT fully POSIX or UNIX compliant.
Website
Visit the official KolibriOS website for more information, downloads, and documentation.
Contributing
We would appreciate any participation in the project and always welcome new users and contributors.
Detailed instructions for the contribution process can be found in the contributing guide.
Common list of tasks, issues and enhancement proposals can be found on this page.
Special thanks
The KolibriOS team expresses special thanks to the author of the 32-bit MenuetOS, Ville Turjanmaa. We also want to note that all MenuetOS copyrights have been preserved.