HTTP_STRICT ifdefs out behavior introduced in 50b9bec

Fixes #37.
v0.6
Ryan Dahl 14 years ago
parent b1c2cf83fd
commit 2839784927

@ -1,5 +1,6 @@
OPT_DEBUG=-O0 -g -Wall -Wextra -Werror -I. CPPFLAGS?=-DHTTP_PARSER_STRICT=1
OPT_FAST=-O3 -DHTTP_PARSER_STRICT=0 -I. OPT_DEBUG=-O0 -g -Wall -Wextra -Werror -I. $(CPPFLAGS)
OPT_FAST=-O3 -DHTTP_PARSER_STRICT=0 -I. $(CPPFLAGS)
CC?=gcc CC?=gcc

@ -191,6 +191,9 @@ static const uint8_t normal_url_char[256] = {
/* 120 x 121 y 122 z 123 { 124 | 125 } 126 ~ 127 del */ /* 120 x 121 y 122 z 123 { 124 | 125 } 126 ~ 127 del */
1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0,
#if HTTP_PARSER_STRICT
0
#else
/* Remainder of non-ASCII range are accepted as-is to support implicitly UTF-8 /* Remainder of non-ASCII range are accepted as-is to support implicitly UTF-8
encoded paths. This is out of spec, but clients generate this and most other encoded paths. This is out of spec, but clients generate this and most other
HTTP servers support it. We should, too. */ HTTP servers support it. We should, too. */
@ -210,7 +213,9 @@ static const uint8_t normal_url_char[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1 }; 1, 1, 1, 1, 1, 1, 1, 1
#endif
}; /* normal_url_char */
enum state enum state

@ -49,8 +49,6 @@ typedef int ssize_t;
*/ */
#ifndef HTTP_PARSER_STRICT #ifndef HTTP_PARSER_STRICT
# define HTTP_PARSER_STRICT 1 # define HTTP_PARSER_STRICT 1
#else
# define HTTP_PARSER_STRICT 0
#endif #endif

@ -582,6 +582,7 @@ const struct message requests[] =
,.body= "" ,.body= ""
} }
#if !HTTP_PARSER_STRICT
#define UTF8_PATH_REQ 21 #define UTF8_PATH_REQ 21
, {.name= "utf-8 path request" , {.name= "utf-8 path request"
,.type= HTTP_REQUEST ,.type= HTTP_REQUEST
@ -602,6 +603,7 @@ const struct message requests[] =
} }
,.body= "" ,.body= ""
} }
#endif /* !HTTP_PARSER_STRICT */
#define QUERY_TERMINATED_HOST 22 #define QUERY_TERMINATED_HOST 22
, {.name= "host terminated by a query string" , {.name= "host terminated by a query string"

Loading…
Cancel
Save