nodejs / http-parser

http request/response parser for c
MIT License
6.32k stars 1.53k forks source link

Fix ABI breakage #503

Closed bnoordhuis closed 4 years ago

bnoordhuis commented 4 years ago

Fix ABI breakage introduced in commit 7d5c99d ("Support multi-coding Transfer-Encoding") by undoing the change in sizeof(http_parser).

Restore the size of the flags field and shrink the index field from 7 to 5 bits. It track strings up to strlen("Transfer-Encoding") bytes in size so 2^5 == 32 is wide enough.

Fixes: https://github.com/nodejs/http-parser/issues/502

maxcrees commented 4 years ago

This doesn't resolve the problem with enum http_errno. I think INVALID_TRANSFER_ENCODING needs to be moved to the end of HTTP_ERRNO_MAP or something.

bnoordhuis commented 4 years ago

Good call, I forgot to update that one. Done in a fix-up commit.