ext/http11/http11_parser.c in mongrel-0.3.11 vs ext/http11/http11_parser.c in mongrel-0.3.12
- old
+ new
@@ -7,11 +7,11 @@
#include <string.h>
#define MARK(S,F) assert((F) - (S)->mark >= 0); (S)->mark = (F);
/** machine **/
-#line 98 "ext/http11/http11_parser.rl"
+#line 101 "ext/http11/http11_parser.rl"
/** Data **/
#line 18 "ext/http11/http11_parser.c"
@@ -19,20 +19,20 @@
static int http_parser_first_final = 53;
static int http_parser_error = 1;
-#line 102 "ext/http11/http11_parser.rl"
+#line 105 "ext/http11/http11_parser.rl"
int http_parser_init(http_parser *parser) {
int cs = 0;
#line 30 "ext/http11/http11_parser.c"
{
cs = http_parser_start;
}
-#line 106 "ext/http11/http11_parser.rl"
+#line 109 "ext/http11/http11_parser.rl"
parser->cs = cs;
parser->body_start = NULL;
parser->content_len = 0;
parser->mark = NULL;
parser->nread = 0;
@@ -303,28 +303,31 @@
goto tr40;
goto st1;
tr40:
#line 46 "ext/http11/http11_parser.rl"
{
- parser->body_start = p+1; goto _out53;
+ parser->body_start = p+1;
+ if(parser->header_done != NULL)
+ parser->header_done(parser->data, p, 0);
+ goto _out53;
}
goto st53;
st53:
if ( ++p == pe )
goto _out53;
case 53:
-#line 316 "ext/http11/http11_parser.c"
+#line 319 "ext/http11/http11_parser.c"
goto st1;
tr36:
#line 16 "ext/http11/http11_parser.rl"
{ parser->field_start = p; }
goto st22;
st22:
if ( ++p == pe )
goto _out22;
case 22:
-#line 326 "ext/http11/http11_parser.c"
+#line 329 "ext/http11/http11_parser.c"
switch( (*p) ) {
case 33: goto st22;
case 58: goto tr32;
case 124: goto st22;
case 126: goto st22;
@@ -355,11 +358,11 @@
goto st23;
st23:
if ( ++p == pe )
goto _out23;
case 23:
-#line 361 "ext/http11/http11_parser.c"
+#line 364 "ext/http11/http11_parser.c"
if ( (*p) == 13 )
goto tr49;
goto tr52;
tr52:
#line 21 "ext/http11/http11_parser.rl"
@@ -367,11 +370,11 @@
goto st24;
st24:
if ( ++p == pe )
goto _out24;
case 24:
-#line 373 "ext/http11/http11_parser.c"
+#line 376 "ext/http11/http11_parser.c"
if ( (*p) == 13 )
goto tr49;
goto st24;
tr28:
#line 14 "ext/http11/http11_parser.rl"
@@ -379,11 +382,11 @@
goto st25;
st25:
if ( ++p == pe )
goto _out25;
case 25:
-#line 385 "ext/http11/http11_parser.c"
+#line 388 "ext/http11/http11_parser.c"
switch( (*p) ) {
case 43: goto st25;
case 58: goto st26;
}
if ( (*p) < 48 ) {
@@ -404,11 +407,11 @@
goto st26;
st26:
if ( ++p == pe )
goto _out26;
case 26:
-#line 410 "ext/http11/http11_parser.c"
+#line 413 "ext/http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr34;
case 37: goto st27;
case 60: goto st1;
case 62: goto st1;
@@ -452,11 +455,11 @@
goto st29;
st29:
if ( ++p == pe )
goto _out29;
case 29:
-#line 458 "ext/http11/http11_parser.c"
+#line 461 "ext/http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr34;
case 37: goto st31;
case 47: goto st1;
case 60: goto st1;
@@ -523,11 +526,11 @@
goto st33;
st33:
if ( ++p == pe )
goto _out33;
case 33:
-#line 529 "ext/http11/http11_parser.c"
+#line 532 "ext/http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr46;
case 37: goto tr51;
case 60: goto st1;
case 62: goto st1;
@@ -545,11 +548,11 @@
goto st34;
st34:
if ( ++p == pe )
goto _out34;
case 34:
-#line 551 "ext/http11/http11_parser.c"
+#line 554 "ext/http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr46;
case 37: goto st35;
case 60: goto st1;
case 62: goto st1;
@@ -567,11 +570,11 @@
goto st35;
st35:
if ( ++p == pe )
goto _out35;
case 35:
-#line 573 "ext/http11/http11_parser.c"
+#line 576 "ext/http11/http11_parser.c"
if ( (*p) < 65 ) {
if ( 48 <= (*p) && (*p) <= 57 )
goto st36;
} else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
@@ -598,11 +601,11 @@
goto st37;
st37:
if ( ++p == pe )
goto _out37;
case 37:
-#line 604 "ext/http11/http11_parser.c"
+#line 607 "ext/http11/http11_parser.c"
if ( (*p) == 69 )
goto st38;
goto st1;
st38:
if ( ++p == pe )
@@ -617,11 +620,11 @@
goto st39;
st39:
if ( ++p == pe )
goto _out39;
case 39:
-#line 623 "ext/http11/http11_parser.c"
+#line 626 "ext/http11/http11_parser.c"
if ( (*p) == 69 )
goto st40;
goto st1;
st40:
if ( ++p == pe )
@@ -643,11 +646,11 @@
goto st42;
st42:
if ( ++p == pe )
goto _out42;
case 42:
-#line 649 "ext/http11/http11_parser.c"
+#line 652 "ext/http11/http11_parser.c"
if ( (*p) == 80 )
goto st43;
goto st1;
st43:
if ( ++p == pe )
@@ -690,11 +693,11 @@
goto st48;
st48:
if ( ++p == pe )
goto _out48;
case 48:
-#line 696 "ext/http11/http11_parser.c"
+#line 699 "ext/http11/http11_parser.c"
switch( (*p) ) {
case 79: goto st49;
case 85: goto st38;
}
goto st1;
@@ -711,11 +714,11 @@
goto st50;
st50:
if ( ++p == pe )
goto _out50;
case 50:
-#line 717 "ext/http11/http11_parser.c"
+#line 720 "ext/http11/http11_parser.c"
if ( (*p) == 82 )
goto st51;
goto st1;
st51:
if ( ++p == pe )
@@ -786,19 +789,19 @@
_out51: cs = 51; goto _out;
_out52: cs = 52; goto _out;
_out: {}
}
-#line 125 "ext/http11/http11_parser.rl"
+#line 128 "ext/http11/http11_parser.rl"
parser->cs = cs;
parser->nread = p - buffer;
if(parser->body_start) {
/* final \r\n combo encountered so stop right here */
-#line 799 "ext/http11/http11_parser.c"
-#line 131 "ext/http11/http11_parser.rl"
+#line 802 "ext/http11/http11_parser.c"
+#line 134 "ext/http11/http11_parser.rl"
parser->nread++;
}
return(parser->nread);
}
@@ -806,11 +809,11 @@
int http_parser_finish(http_parser *parser)
{
int cs = parser->cs;
-#line 812 "ext/http11/http11_parser.c"
-#line 142 "ext/http11/http11_parser.rl"
+#line 815 "ext/http11/http11_parser.c"
+#line 145 "ext/http11/http11_parser.rl"
parser->cs = cs;
if (http_parser_has_error(parser) ) {
return -1;