diff options
Diffstat (limited to 'ext/http11/http11_parser.c')
-rw-r--r-- | ext/http11/http11_parser.c | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/ext/http11/http11_parser.c b/ext/http11/http11_parser.c index c17d907..fcbfa31 100644 --- a/ext/http11/http11_parser.c +++ b/ext/http11/http11_parser.c @@ -9,7 +9,7 @@ #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 **/ @@ -21,7 +21,7 @@ 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; @@ -30,7 +30,7 @@ int http_parser_init(http_parser *parser) { { 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; @@ -305,14 +305,17 @@ case 21: 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" @@ -322,7 +325,7 @@ 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; @@ -357,7 +360,7 @@ 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; @@ -369,7 +372,7 @@ 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; @@ -381,7 +384,7 @@ 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; @@ -406,7 +409,7 @@ 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; @@ -454,7 +457,7 @@ 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; @@ -525,7 +528,7 @@ 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; @@ -547,7 +550,7 @@ 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; @@ -569,7 +572,7 @@ 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; @@ -600,7 +603,7 @@ 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; @@ -619,7 +622,7 @@ 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; @@ -645,7 +648,7 @@ 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; @@ -692,7 +695,7 @@ 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; @@ -713,7 +716,7 @@ 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; @@ -788,15 +791,15 @@ case 52: _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++; } @@ -808,8 +811,8 @@ 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; |