forked from AndreLouisCaron/httpxx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes issue AndreLouisCaron#5 (off-by-one error in 'feed()').
'http_parser_execute()' does not mark the last byte of headers as consumed after calling the 'on_headers_complete()' callback if 'http_parser_pause()' is called from the callback. This fix forces the parser to consume the extra byte by unpausing, then calling 'http_parser_execute()' again with the last byte. Note that this byte is always available since it had to be there to trigger the callback that pauses the parser.
- Loading branch information
1 parent
dd7161f
commit fbd0422
Showing
3 changed files
with
61 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
POST /index.html HTTP/1.1 | ||
Host: www.example.com | ||
Content-Length: 13 | ||
|
||
Hello, world! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters