Skip to content
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

Support large http response #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

A4Vision
Copy link

@A4Vision A4Vision commented Feb 2, 2025

Problem
if one tries to respond with a large respnse, the server crashes:

response.write(s) // s is a large string;

Solution
Write the output in a for-loop, flushing in each iteration

space = end_ - cursor_;
}
assert(pos < s.size());
assert(space > 0);
Copy link
Contributor

@cong1920 cong1920 Feb 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this assert could be defensive to anything as the space is type size_t which is unsigned.

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.

2 participants