Skip to content

Fix incorrect byte calculation in HTTP response handling #965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

VinayakTiwari1103
Copy link

Fix: Correct Byte Calculation in HTTP Response Handling

Issue

This fix addresses an issue where bytes_received includes both header and body bytes, while content_len only refers to the body size. The previous calculation led to:

  • Over-requesting bytes for large response bodies.
  • Potential timeouts or hangs while waiting for non-existent bytes.

Fix Implemented

1. Correctly calculates received body bytes:

body_bytes_received = bytes_received - header_len.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant