Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Chunk extensions callbacks #430

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

martin-gabris
Copy link

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.

Added data callback to access data in chunked encoding
extensions.
@bnoordhuis
Copy link
Member

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.

@martin-gabris
Copy link
Author

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 d767545, which caused just minor and release version change from 2.4.2 to 2.5.0.

@martin-gabris
Copy link
Author

martin-gabris commented May 29, 2018

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?

@bnoordhuis
Copy link
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants