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

HTTP read rule assumes that the parser consumes all of the readable_region. #2

Open
sadjad opened this issue Jan 30, 2020 · 1 comment

Comments

@sadjad
Copy link
Member

sadjad commented Jan 30, 2020

https://github.com/keithw/mush/blob/99b598a4366bb10cfe4326703b3af39925a58a12/src/examples/fun.cc#L126

With the new changes, it is possible that the HTTPResponseParser::parse doesn't consume all of the readable_region (for example, in case of a partial header in the buffer). That will lead this rule to not emptying the readable_region, and leads the EventPoll to repeatedly calling this rule.

@keithw
Copy link
Collaborator

keithw commented Jan 31, 2020

Hmmm.... yes, you're right. This zero-copy stuff is tricky. What's the right condition here...? Maybe the right condition is something more like "cumulative # of bytes pushed to the RingBuffer is > than what the HTTPMessageSequence has scanned" ?

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

No branches or pull requests

2 participants