diff --git a/ext/puma_http11/http11_parser.c b/ext/puma_http11/http11_parser.c index 725eb908b4..95dd399222 100644 --- a/ext/puma_http11/http11_parser.c +++ b/ext/puma_http11/http11_parser.c @@ -31,30 +31,27 @@ static void snake_upcase_char(char *c) /** Machine **/ -#line 78 "ext/puma_http11/http11_parser.rl" +#line 79 "ext/puma_http11/http11_parser.rl" /** Data **/ -#line 39 "ext/puma_http11/http11_parser.c" +#line 40 "ext/puma_http11/http11_parser.c" static const int puma_parser_start = 1; static const int puma_parser_first_final = 47; static const int puma_parser_error = 0; -static const int puma_parser_en_main = 1; - - -#line 82 "ext/puma_http11/http11_parser.rl" +#line 83 "ext/puma_http11/http11_parser.rl" int puma_parser_init(puma_parser *parser) { int cs = 0; - -#line 52 "ext/puma_http11/http11_parser.c" + +#line 53 "ext/puma_http11/http11_parser.c" { cs = puma_parser_start; } -#line 86 "ext/puma_http11/http11_parser.rl" +#line 87 "ext/puma_http11/http11_parser.rl" parser->cs = cs; parser->body_start = 0; parser->content_len = 0; @@ -74,16 +71,10 @@ size_t puma_parser_execute(puma_parser *parser, const char *buffer, size_t len, const char *p, *pe; int cs = parser->cs; - assert(off <= len && "offset past end of buffer"); - p = buffer+off; pe = buffer+len; - /* assert(*pe == '\0' && "pointer does not end on NUL"); */ - assert(pe - p == len - off && "pointers aren't same distance"); - - -#line 86 "ext/puma_http11/http11_parser.c" +#line 87 "ext/puma_http11/http11_parser.c" { if ( p == pe ) goto _test_eof; @@ -107,14 +98,14 @@ case 1: cs = 0; goto _out; tr0: -#line 34 "ext/puma_http11/http11_parser.rl" +#line 35 "ext/puma_http11/http11_parser.rl" { MARK(mark, p); } goto st2; st2: if ( ++p == pe ) goto _test_eof2; case 2: -#line 117 "ext/puma_http11/http11_parser.c" +#line 118 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 32: goto tr2; case 36: goto st28; @@ -130,8 +121,8 @@ case 2: goto st28; goto st0; tr2: -#line 47 "ext/puma_http11/http11_parser.rl" - { +#line 48 "ext/puma_http11/http11_parser.rl" + { parser->request_method(parser, PTR_TO(mark), LEN(mark, p)); } goto st3; @@ -139,7 +130,7 @@ case 2: if ( ++p == pe ) goto _test_eof3; case 3: -#line 142 "ext/puma_http11/http11_parser.c" +#line 143 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 42: goto tr4; case 43: goto tr5; @@ -156,68 +147,68 @@ case 3: goto tr5; goto st0; tr4: -#line 34 "ext/puma_http11/http11_parser.rl" +#line 35 "ext/puma_http11/http11_parser.rl" { MARK(mark, p); } goto st4; st4: if ( ++p == pe ) goto _test_eof4; case 4: -#line 166 "ext/puma_http11/http11_parser.c" +#line 167 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 32: goto tr8; case 35: goto tr9; } goto st0; tr8: -#line 50 "ext/puma_http11/http11_parser.rl" - { +#line 51 "ext/puma_http11/http11_parser.rl" + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st5; tr31: -#line 34 "ext/puma_http11/http11_parser.rl" +#line 35 "ext/puma_http11/http11_parser.rl" { MARK(mark, p); } -#line 53 "ext/puma_http11/http11_parser.rl" +#line 54 "ext/puma_http11/http11_parser.rl" { parser->fragment(parser, PTR_TO(mark), LEN(mark, p)); } goto st5; tr33: -#line 53 "ext/puma_http11/http11_parser.rl" +#line 54 "ext/puma_http11/http11_parser.rl" { parser->fragment(parser, PTR_TO(mark), LEN(mark, p)); } goto st5; tr37: -#line 66 "ext/puma_http11/http11_parser.rl" +#line 67 "ext/puma_http11/http11_parser.rl" { parser->request_path(parser, PTR_TO(mark), LEN(mark,p)); } -#line 50 "ext/puma_http11/http11_parser.rl" - { +#line 51 "ext/puma_http11/http11_parser.rl" + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st5; tr44: -#line 57 "ext/puma_http11/http11_parser.rl" - { MARK(query_start, p); } #line 58 "ext/puma_http11/http11_parser.rl" - { + { MARK(query_start, p); } +#line 59 "ext/puma_http11/http11_parser.rl" + { parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p)); } -#line 50 "ext/puma_http11/http11_parser.rl" - { +#line 51 "ext/puma_http11/http11_parser.rl" + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st5; tr47: -#line 58 "ext/puma_http11/http11_parser.rl" - { +#line 59 "ext/puma_http11/http11_parser.rl" + { parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p)); } -#line 50 "ext/puma_http11/http11_parser.rl" - { +#line 51 "ext/puma_http11/http11_parser.rl" + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st5; @@ -225,19 +216,19 @@ case 4: if ( ++p == pe ) goto _test_eof5; case 5: -#line 228 "ext/puma_http11/http11_parser.c" +#line 229 "ext/puma_http11/http11_parser.c" if ( (*p) == 72 ) goto tr10; goto st0; tr10: -#line 34 "ext/puma_http11/http11_parser.rl" +#line 35 "ext/puma_http11/http11_parser.rl" { MARK(mark, p); } goto st6; st6: if ( ++p == pe ) goto _test_eof6; case 6: -#line 240 "ext/puma_http11/http11_parser.c" +#line 241 "ext/puma_http11/http11_parser.c" if ( (*p) == 84 ) goto st7; goto st0; @@ -295,21 +286,21 @@ case 13: goto st13; goto st0; tr18: -#line 62 "ext/puma_http11/http11_parser.rl" - { +#line 63 "ext/puma_http11/http11_parser.rl" + { parser->http_version(parser, PTR_TO(mark), LEN(mark, p)); } goto st14; tr26: -#line 43 "ext/puma_http11/http11_parser.rl" - { MARK(mark, p); } #line 44 "ext/puma_http11/http11_parser.rl" + { MARK(mark, p); } +#line 45 "ext/puma_http11/http11_parser.rl" { parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p)); } goto st14; tr29: -#line 44 "ext/puma_http11/http11_parser.rl" +#line 45 "ext/puma_http11/http11_parser.rl" { parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p)); } @@ -318,7 +309,7 @@ case 13: if ( ++p == pe ) goto _test_eof14; case 14: -#line 321 "ext/puma_http11/http11_parser.c" +#line 322 "ext/puma_http11/http11_parser.c" if ( (*p) == 10 ) goto st15; goto st0; @@ -358,9 +349,9 @@ case 16: goto tr22; goto st0; tr22: -#line 70 "ext/puma_http11/http11_parser.rl" - { - parser->body_start = p - buffer + 1; +#line 71 "ext/puma_http11/http11_parser.rl" + { + parser->body_start = p - buffer + 1; parser->header_done(parser, p + 1, pe - p - 1); {p++; cs = 47; goto _out;} } @@ -369,23 +360,23 @@ case 16: if ( ++p == pe ) goto _test_eof47; case 47: -#line 372 "ext/puma_http11/http11_parser.c" +#line 373 "ext/puma_http11/http11_parser.c" goto st0; tr21: -#line 37 "ext/puma_http11/http11_parser.rl" - { MARK(field_start, p); } #line 38 "ext/puma_http11/http11_parser.rl" + { MARK(field_start, p); } +#line 39 "ext/puma_http11/http11_parser.rl" { snake_upcase_char((char *)p); } goto st17; tr23: -#line 38 "ext/puma_http11/http11_parser.rl" +#line 39 "ext/puma_http11/http11_parser.rl" { snake_upcase_char((char *)p); } goto st17; st17: if ( ++p == pe ) goto _test_eof17; case 17: -#line 388 "ext/puma_http11/http11_parser.c" +#line 389 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 33: goto tr23; case 58: goto tr24; @@ -411,72 +402,72 @@ case 17: goto tr23; goto st0; tr24: -#line 39 "ext/puma_http11/http11_parser.rl" - { +#line 40 "ext/puma_http11/http11_parser.rl" + { parser->field_len = LEN(field_start, p); } goto st18; tr27: -#line 43 "ext/puma_http11/http11_parser.rl" +#line 44 "ext/puma_http11/http11_parser.rl" { MARK(mark, p); } goto st18; st18: if ( ++p == pe ) goto _test_eof18; case 18: -#line 427 "ext/puma_http11/http11_parser.c" +#line 428 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 13: goto tr26; case 32: goto tr27; } goto tr25; tr25: -#line 43 "ext/puma_http11/http11_parser.rl" +#line 44 "ext/puma_http11/http11_parser.rl" { MARK(mark, p); } goto st19; st19: if ( ++p == pe ) goto _test_eof19; case 19: -#line 441 "ext/puma_http11/http11_parser.c" +#line 442 "ext/puma_http11/http11_parser.c" if ( (*p) == 13 ) goto tr29; goto st19; tr9: -#line 50 "ext/puma_http11/http11_parser.rl" - { +#line 51 "ext/puma_http11/http11_parser.rl" + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st20; tr38: -#line 66 "ext/puma_http11/http11_parser.rl" +#line 67 "ext/puma_http11/http11_parser.rl" { parser->request_path(parser, PTR_TO(mark), LEN(mark,p)); } -#line 50 "ext/puma_http11/http11_parser.rl" - { +#line 51 "ext/puma_http11/http11_parser.rl" + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st20; tr45: -#line 57 "ext/puma_http11/http11_parser.rl" - { MARK(query_start, p); } #line 58 "ext/puma_http11/http11_parser.rl" - { + { MARK(query_start, p); } +#line 59 "ext/puma_http11/http11_parser.rl" + { parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p)); } -#line 50 "ext/puma_http11/http11_parser.rl" - { +#line 51 "ext/puma_http11/http11_parser.rl" + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st20; tr48: -#line 58 "ext/puma_http11/http11_parser.rl" - { +#line 59 "ext/puma_http11/http11_parser.rl" + { parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p)); } -#line 50 "ext/puma_http11/http11_parser.rl" - { +#line 51 "ext/puma_http11/http11_parser.rl" + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st20; @@ -484,7 +475,7 @@ case 19: if ( ++p == pe ) goto _test_eof20; case 20: -#line 487 "ext/puma_http11/http11_parser.c" +#line 488 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 32: goto tr31; case 60: goto st0; @@ -498,14 +489,14 @@ case 20: goto st0; goto tr30; tr30: -#line 34 "ext/puma_http11/http11_parser.rl" +#line 35 "ext/puma_http11/http11_parser.rl" { MARK(mark, p); } goto st21; st21: if ( ++p == pe ) goto _test_eof21; case 21: -#line 508 "ext/puma_http11/http11_parser.c" +#line 509 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 32: goto tr33; case 60: goto st0; @@ -519,14 +510,14 @@ case 21: goto st0; goto st21; tr5: -#line 34 "ext/puma_http11/http11_parser.rl" +#line 35 "ext/puma_http11/http11_parser.rl" { MARK(mark, p); } goto st22; st22: if ( ++p == pe ) goto _test_eof22; case 22: -#line 529 "ext/puma_http11/http11_parser.c" +#line 530 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 43: goto st22; case 58: goto st23; @@ -544,14 +535,14 @@ case 22: goto st22; goto st0; tr7: -#line 34 "ext/puma_http11/http11_parser.rl" +#line 35 "ext/puma_http11/http11_parser.rl" { MARK(mark, p); } goto st23; st23: if ( ++p == pe ) goto _test_eof23; case 23: -#line 554 "ext/puma_http11/http11_parser.c" +#line 555 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 32: goto tr8; case 34: goto st0; @@ -564,14 +555,14 @@ case 23: goto st0; goto st23; tr6: -#line 34 "ext/puma_http11/http11_parser.rl" +#line 35 "ext/puma_http11/http11_parser.rl" { MARK(mark, p); } goto st24; st24: if ( ++p == pe ) goto _test_eof24; case 24: -#line 574 "ext/puma_http11/http11_parser.c" +#line 575 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 32: goto tr37; case 34: goto st0; @@ -586,7 +577,7 @@ case 24: goto st0; goto st24; tr39: -#line 66 "ext/puma_http11/http11_parser.rl" +#line 67 "ext/puma_http11/http11_parser.rl" { parser->request_path(parser, PTR_TO(mark), LEN(mark,p)); } @@ -595,7 +586,7 @@ case 24: if ( ++p == pe ) goto _test_eof25; case 25: -#line 598 "ext/puma_http11/http11_parser.c" +#line 599 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 32: goto tr8; case 34: goto st0; @@ -609,7 +600,7 @@ case 25: goto st0; goto st25; tr40: -#line 66 "ext/puma_http11/http11_parser.rl" +#line 67 "ext/puma_http11/http11_parser.rl" { parser->request_path(parser, PTR_TO(mark), LEN(mark,p)); } @@ -618,7 +609,7 @@ case 25: if ( ++p == pe ) goto _test_eof26; case 26: -#line 621 "ext/puma_http11/http11_parser.c" +#line 622 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 32: goto tr44; case 34: goto st0; @@ -631,14 +622,14 @@ case 26: goto st0; goto tr43; tr43: -#line 57 "ext/puma_http11/http11_parser.rl" +#line 58 "ext/puma_http11/http11_parser.rl" { MARK(query_start, p); } goto st27; st27: if ( ++p == pe ) goto _test_eof27; case 27: -#line 641 "ext/puma_http11/http11_parser.c" +#line 642 "ext/puma_http11/http11_parser.c" switch( (*p) ) { case 32: goto tr47; case 34: goto st0; @@ -982,70 +973,63 @@ case 46: goto tr2; goto st0; } - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof9: cs = 9; goto _test_eof; - _test_eof10: cs = 10; goto _test_eof; - _test_eof11: cs = 11; goto _test_eof; - _test_eof12: cs = 12; goto _test_eof; - _test_eof13: cs = 13; goto _test_eof; - _test_eof14: cs = 14; goto _test_eof; - _test_eof15: cs = 15; goto _test_eof; - _test_eof16: cs = 16; goto _test_eof; - _test_eof47: cs = 47; goto _test_eof; - _test_eof17: cs = 17; goto _test_eof; - _test_eof18: cs = 18; goto _test_eof; - _test_eof19: cs = 19; goto _test_eof; - _test_eof20: cs = 20; goto _test_eof; - _test_eof21: cs = 21; goto _test_eof; - _test_eof22: cs = 22; goto _test_eof; - _test_eof23: cs = 23; goto _test_eof; - _test_eof24: cs = 24; goto _test_eof; - _test_eof25: cs = 25; goto _test_eof; - _test_eof26: cs = 26; goto _test_eof; - _test_eof27: cs = 27; goto _test_eof; - _test_eof28: cs = 28; goto _test_eof; - _test_eof29: cs = 29; goto _test_eof; - _test_eof30: cs = 30; goto _test_eof; - _test_eof31: cs = 31; goto _test_eof; - _test_eof32: cs = 32; goto _test_eof; - _test_eof33: cs = 33; goto _test_eof; - _test_eof34: cs = 34; goto _test_eof; - _test_eof35: cs = 35; goto _test_eof; - _test_eof36: cs = 36; goto _test_eof; - _test_eof37: cs = 37; goto _test_eof; - _test_eof38: cs = 38; goto _test_eof; - _test_eof39: cs = 39; goto _test_eof; - _test_eof40: cs = 40; goto _test_eof; - _test_eof41: cs = 41; goto _test_eof; - _test_eof42: cs = 42; goto _test_eof; - _test_eof43: cs = 43; goto _test_eof; - _test_eof44: cs = 44; goto _test_eof; - _test_eof45: cs = 45; goto _test_eof; - _test_eof46: cs = 46; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof11: cs = 11; goto _test_eof; + _test_eof12: cs = 12; goto _test_eof; + _test_eof13: cs = 13; goto _test_eof; + _test_eof14: cs = 14; goto _test_eof; + _test_eof15: cs = 15; goto _test_eof; + _test_eof16: cs = 16; goto _test_eof; + _test_eof47: cs = 47; goto _test_eof; + _test_eof17: cs = 17; goto _test_eof; + _test_eof18: cs = 18; goto _test_eof; + _test_eof19: cs = 19; goto _test_eof; + _test_eof20: cs = 20; goto _test_eof; + _test_eof21: cs = 21; goto _test_eof; + _test_eof22: cs = 22; goto _test_eof; + _test_eof23: cs = 23; goto _test_eof; + _test_eof24: cs = 24; goto _test_eof; + _test_eof25: cs = 25; goto _test_eof; + _test_eof26: cs = 26; goto _test_eof; + _test_eof27: cs = 27; goto _test_eof; + _test_eof28: cs = 28; goto _test_eof; + _test_eof29: cs = 29; goto _test_eof; + _test_eof30: cs = 30; goto _test_eof; + _test_eof31: cs = 31; goto _test_eof; + _test_eof32: cs = 32; goto _test_eof; + _test_eof33: cs = 33; goto _test_eof; + _test_eof34: cs = 34; goto _test_eof; + _test_eof35: cs = 35; goto _test_eof; + _test_eof36: cs = 36; goto _test_eof; + _test_eof37: cs = 37; goto _test_eof; + _test_eof38: cs = 38; goto _test_eof; + _test_eof39: cs = 39; goto _test_eof; + _test_eof40: cs = 40; goto _test_eof; + _test_eof41: cs = 41; goto _test_eof; + _test_eof42: cs = 42; goto _test_eof; + _test_eof43: cs = 43; goto _test_eof; + _test_eof44: cs = 44; goto _test_eof; + _test_eof45: cs = 45; goto _test_eof; + _test_eof46: cs = 46; goto _test_eof; _test_eof: {} _out: {} } -#line 114 "ext/puma_http11/http11_parser.rl" +#line 115 "ext/puma_http11/http11_parser.rl" if (!puma_parser_has_error(parser)) parser->cs = cs; parser->nread += p - (buffer + off); - assert(p <= pe && "buffer overflow after parsing execute"); - assert(parser->nread <= len && "nread longer than length"); - assert(parser->body_start <= len && "body starts after buffer end"); - assert(parser->mark < len && "mark is after buffer end"); - assert(parser->field_len <= len && "field has length longer than whole buffer"); - assert(parser->field_start < len && "field starts after buffer end"); - return(parser->nread); } diff --git a/ext/puma_http11/http11_parser.rl b/ext/puma_http11/http11_parser.rl index ac01d58a85..880c1d40be 100644 --- a/ext/puma_http11/http11_parser.rl +++ b/ext/puma_http11/http11_parser.rl @@ -29,7 +29,7 @@ static void snake_upcase_char(char *c) /** Machine **/ %%{ - + machine puma_parser; action mark { MARK(mark, fpc); } @@ -37,7 +37,7 @@ static void snake_upcase_char(char *c) action start_field { MARK(field_start, fpc); } action snake_upcase_field { snake_upcase_char((char *)fpc); } - action write_field { + action write_field { parser->field_len = LEN(field_start, fpc); } @@ -45,10 +45,10 @@ static void snake_upcase_char(char *c) action write_value { parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, fpc)); } - action request_method { + action request_method { parser->request_method(parser, PTR_TO(mark), LEN(mark, fpc)); } - action request_uri { + action request_uri { parser->request_uri(parser, PTR_TO(mark), LEN(mark, fpc)); } action fragment { @@ -56,11 +56,11 @@ static void snake_upcase_char(char *c) } action start_query { MARK(query_start, fpc); } - action query_string { + action query_string { parser->query_string(parser, PTR_TO(query_start), LEN(query_start, fpc)); } - action http_version { + action http_version { parser->http_version(parser, PTR_TO(mark), LEN(mark, fpc)); } @@ -68,8 +68,8 @@ static void snake_upcase_char(char *c) parser->request_path(parser, PTR_TO(mark), LEN(mark,fpc)); } - action done { - parser->body_start = fpc - buffer + 1; + action done { + parser->body_start = fpc - buffer + 1; parser->header_done(parser, fpc + 1, pe - fpc - 1); fbreak; } @@ -109,7 +109,7 @@ size_t puma_parser_execute(puma_parser *parser, const char *buffer, size_t len, pe = buffer+len; /* assert(*pe == '\0' && "pointer does not end on NUL"); */ - assert(pe - p == len - off && "pointers aren't same distance"); + assert((size_t) (pe - p) == len - off && "pointers aren't same distance"); %% write exec; diff --git a/ext/puma_http11/mini_ssl.c b/ext/puma_http11/mini_ssl.c index dbc7cf0dc0..e563a543c2 100644 --- a/ext/puma_http11/mini_ssl.c +++ b/ext/puma_http11/mini_ssl.c @@ -244,7 +244,7 @@ void raise_error(SSL* ssl, int result) { const char* err_str; int err = errno; int ssl_err = SSL_get_error(ssl, result); - int verify_err = SSL_get_verify_result(ssl); + int verify_err = (int) SSL_get_verify_result(ssl); if(SSL_ERROR_SYSCALL == ssl_err) { snprintf(msg, sizeof(msg), "System error: %s - %d", strerror(err), err); @@ -257,7 +257,7 @@ void raise_error(SSL* ssl, int result) { err_str, verify_err); } else { - err = ERR_get_error(); + err = (int) ERR_get_error(); ERR_error_string_n(err, buf, sizeof(buf)); snprintf(msg, sizeof(msg), "OpenSSL error: %s - %d", buf, err); diff --git a/ext/puma_http11/org/jruby/puma/Http11Parser.java b/ext/puma_http11/org/jruby/puma/Http11Parser.java index 24efdcb227..626ee81cae 100644 --- a/ext/puma_http11/org/jruby/puma/Http11Parser.java +++ b/ext/puma_http11/org/jruby/puma/Http11Parser.java @@ -182,9 +182,6 @@ private static byte[] init__puma_parser_trans_actions_0() static final int puma_parser_first_final = 47; static final int puma_parser_error = 0; -static final int puma_parser_en_main = 1; - - // line 69 "ext/puma_http11/http11_parser.java.rl" public static interface ElementCB { @@ -220,7 +217,7 @@ public static class HttpParser { public void init() { cs = 0; - + // line 225 "ext/puma_http11/org/jruby/puma/Http11Parser.java" { cs = puma_parser_start; @@ -252,7 +249,7 @@ public int execute(ByteList buffer, int off) { byte[] data = buffer.bytes(); parser.buffer = buffer; - + // line 257 "ext/puma_http11/org/jruby/puma/Http11Parser.java" { int _klen; @@ -347,7 +344,7 @@ else if ( data[p] > _puma_parser_trans_keys[_mid+1] ) break; case 3: // line 17 "ext/puma_http11/http11_parser.java.rl" - { + { parser.field_len = p-parser.field_start; } break; @@ -357,7 +354,7 @@ else if ( data[p] > _puma_parser_trans_keys[_mid+1] ) break; case 5: // line 22 "ext/puma_http11/http11_parser.java.rl" - { + { if(parser.http_field != null) { parser.http_field.call(parser.data, parser.field_start, parser.field_len, parser.mark, p-parser.mark); } @@ -365,21 +362,21 @@ else if ( data[p] > _puma_parser_trans_keys[_mid+1] ) break; case 6: // line 27 "ext/puma_http11/http11_parser.java.rl" - { - if(parser.request_method != null) + { + if(parser.request_method != null) parser.request_method.call(parser.data, parser.mark, p-parser.mark); } break; case 7: // line 31 "ext/puma_http11/http11_parser.java.rl" - { + { if(parser.request_uri != null) parser.request_uri.call(parser.data, parser.mark, p-parser.mark); } break; case 8: // line 35 "ext/puma_http11/http11_parser.java.rl" - { + { if(parser.fragment != null) parser.fragment.call(parser.data, parser.mark, p-parser.mark); } @@ -390,14 +387,14 @@ else if ( data[p] > _puma_parser_trans_keys[_mid+1] ) break; case 10: // line 41 "ext/puma_http11/http11_parser.java.rl" - { + { if(parser.query_string != null) parser.query_string.call(parser.data, parser.query_start, p-parser.query_start); } break; case 11: // line 46 "ext/puma_http11/http11_parser.java.rl" - { + { if(parser.http_version != null) parser.http_version.call(parser.data, parser.mark, p-parser.mark); } @@ -411,8 +408,8 @@ else if ( data[p] > _puma_parser_trans_keys[_mid+1] ) break; case 13: // line 56 "ext/puma_http11/http11_parser.java.rl" - { - parser.body_start = p + 1; + { + parser.body_start = p + 1; if(parser.header_done != null) parser.header_done.call(parser.data, p + 1, pe - p - 1); { p += 1; _goto_targ = 5; if (true) continue _goto;} @@ -442,7 +439,7 @@ else if ( data[p] > _puma_parser_trans_keys[_mid+1] ) parser.cs = cs; parser.nread += (p - off); - + assert p <= pe : "buffer overflow after parsing execute"; assert parser.nread <= len : "nread longer than length"; assert parser.body_start <= len : "body starts after buffer end";