http-parser icon indicating copy to clipboard operation
http-parser copied to clipboard

Chunk extensions callbacks

Open martin-gabris opened this issue 7 years ago • 4 comments

There are already callbacks to get size of chunk and it's body as well as info when chunk was parsed, but I was missing a clean way to get to chunk extension data. Previously, parser just skipped the extension data as long as it started with space or semicolon.

I also changed tests with non-zero chunk extensions to check whether they were parsed correctly.

martin-gabris avatar May 29 '18 15:05 martin-gabris

Thanks for the PR but please be aware that because it changes the ABI, it can't land until the next major release and that is not expected to happen anytime soon. See #159 from 2013 which adds the same hooks.

bnoordhuis avatar May 29 '18 16:05 bnoordhuis

By changing ABI here you mean changes to http_parser_settings structs? The hooks in #159 are not same, they are just notifications and they eventually landed into parser in 2015 in commit d7675453a6c03180572f084e95eea0d02df39164, which caused just minor and release version change from 2.4.2 to 2.5.0.

martin-gabris avatar May 29 '18 17:05 martin-gabris

Anyway I don't think it's possible to do that without changing structs (I don't think it's good to do some ugly hacks to hide pointer to data and size in some other part of http_parser struct to be processed in some ther callback), so just leave this PR open until major release?

martin-gabris avatar May 29 '18 17:05 martin-gabris

Yep. That other PR really shouldn't have landed without a major version bump but that wasn't on my watch.

bnoordhuis avatar May 29 '18 17:05 bnoordhuis