Skip to content

Add proper stateful codec support to coro-net. - #288

Merged
creationix merged 2 commits into
masterfrom
fix-http-parser-state-scope
Jun 25, 2021
Merged

creationix merged 2 commits into
masterfrom
fix-http-parser-state-scope

Conversation

@creationix

Copy link
Copy Markdown
Member

http-codec is a stateful parser and this wasn't really supported properly.
Before this patch, coro-net would reuse the exact same stateful parser
for all concurrent and future streams which has many issues.

This was probably the cause of many bugs including the one that makes
the production website hang whenever a request triggers http raw body mode.

This PR updates coro-net to now support both statefull and stateless codecs
and updates coro-http, coro-websocket and others to use the new feature.

Third-party libraries that use coro-net directly with http-codec will need
a similar update.

http-codec is a stateful parser and this wasn't really supported properly.
Before this patch, coro-net would reuse the exact same stateful parser
for all concurrent and future streams which has many issues.

This was probably the cause of many bugs including the one that makes
the production website hang whenever a request triggers http raw body mode.

This PR updates coro-net to now support both statefull and stateless codecs
and updates coro-http, coro-websocket and others to use the new feature.

Third-party libraries that use coro-net directly with http-codec will need
a similar update.
@creationix

Copy link
Copy Markdown
Member Author

Many thanks to @Bilal2453 for helping me find the root cause!

@Bilal2453

Copy link
Copy Markdown
Contributor

Works like a charm! Thanks for putting time into this.

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