You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.
master branch as of commit 4dae120, http_parser.c:1788
Neither SET_ERRNO nor RETURN are necessarily called in this case (s_headers_almost_done) and thus when on_headers_complete(parser) is called, parser still contains an old nread value (0 if it's the first parse attempt).
In my test cases, inserting parser->nread = nread; just before line 1788 solves the issue, but based on that assignment being contained solely within the SET_ERRNO and RETURN defines, someone more familiary with the code may wish to implement it elsewhere.
The text was updated successfully, but these errors were encountered:
p->nread is only for tracking if we moved past HTTP_MAX_HEADER_SIZE. At line 1788, that doesn't matter anymore because we're done parsing headers.
I've fixed off-by-one errors in the past but that's not that useful here, it'd only benefit downstream users that inappropriately use p->nread. It's private and marked as such in http_parser.h but some projects still use it.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
master branch as of commit 4dae120, http_parser.c:1788
Neither SET_ERRNO nor RETURN are necessarily called in this case (s_headers_almost_done) and thus when on_headers_complete(parser) is called, parser still contains an old nread value (0 if it's the first parse attempt).
In my test cases, inserting
parser->nread = nread;
just before line 1788 solves the issue, but based on that assignment being contained solely within the SET_ERRNO and RETURN defines, someone more familiary with the code may wish to implement it elsewhere.The text was updated successfully, but these errors were encountered: