Permalink
Browse files

Facility to report detailed parsing errors.

- Add http_errno enum w/ values for many parsing error conditions. Stash
  this in http_parser.state if the 0x80 bit is set.
- Report line numbers on error generation if the (new) HTTP_PARSER_DEBUG
  cpp symbol is set. Increases http_parser struct size by 8 bytes in
  this case.
- Add http_errno_*() methods to help turning errno values into
  human-readable messages.
  • Loading branch information...
1 parent ddbbc07 commit 9114e58a776bf0add8d56e49da2f90247c7ce26e @pgriess pgriess committed May 23, 2011
Showing with 309 additions and 47 deletions.
  1. +2 −2 Makefile
  2. +189 −30 http_parser.c
  3. +87 −1 http_parser.h
  4. +31 −14 test.c
View
@@ -1,6 +1,6 @@
CPPFLAGS?=-Wall -Wextra -Werror -I.
-OPT_DEBUG=$(CPPFLAGS) -O0 -g -DHTTP_PARSER_STRICT=1
-OPT_FAST=$(CPPFLAGS) -O3 -DHTTP_PARSER_STRICT=0
+OPT_DEBUG=$(CPPFLAGS) -O0 -g -DHTTP_PARSER_STRICT=1 -DHTTP_PARSER_DEBUG=1
+OPT_FAST=$(CPPFLAGS) -O3 -DHTTP_PARSER_STRICT=0 -DHTTP_PARSER_DEBUG=0
CC?=gcc
AR?=ar
Oops, something went wrong.

0 comments on commit 9114e58

Please sign in to comment.