Sorry for the non-minimal reproduction of the issue that I found. I still wanted to report it.
What happens:
After about 10k chars parsed of responses with gzip-encoded bodies, the parser will go into a state where it will reliably call the "body" callback with the full message as the body slice, instead of it pointing to just the body.
This works if it's a single large message, or if the same parser instance is repeatedly used for messages until this happens.
This is a node.js server impl that allows one to play with the reproduction:
Originally I really liked this parser's API, more than others' that are available. Especially since chunked messages would be handled properly. But on encountering this issue and after an upgrade of the underlying nodejs/http-parser dependency did not yield any improvement, I switched over to the httparse crate. (For anyone finding this via google and wondering about potential solutions. You have to write your own brief logic for figuring out how long the body is, and potentially for chunked encoding if you need that (I didn't).)
Sorry for the non-minimal reproduction of the issue that I found. I still wanted to report it.
What happens:
After about 10k chars parsed of responses with gzip-encoded bodies, the parser will go into a state where it will reliably call the "body" callback with the full message as the body slice, instead of it pointing to just the body. This works if it's a single large message, or if the same parser instance is repeatedly used for messages until this happens.
This is a node.js server impl that allows one to play with the reproduction:
My Rust code looked roughly like this:
Originally I really liked this parser's API, more than others' that are available. Especially since chunked messages would be handled properly. But on encountering this issue and after an upgrade of the underlying nodejs/http-parser dependency did not yield any improvement, I switched over to the httparse crate. (For anyone finding this via google and wondering about potential solutions. You have to write your own brief logic for figuring out how long the body is, and potentially for chunked encoding if you need that (I didn't).)