ext/puma_http11/http11_parser.c in piesync-puma-3.12.6.1 vs ext/puma_http11/http11_parser.c in piesync-puma-5.4.0.1
- old
+ new
@@ -31,34 +31,32 @@
#define PTR_TO(F) (buffer + parser->F)
/** Machine **/
-#line 79 "ext/puma_http11/http11_parser.rl"
+#line 81 "ext/puma_http11/http11_parser.rl"
/** Data **/
-#line 40 "ext/puma_http11/http11_parser.c"
+#line 42 "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_first_final = 46;
static const int puma_parser_error = 0;
-static const int puma_parser_en_main = 1;
+#line 85 "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 53 "ext/puma_http11/http11_parser.c"
{
cs = puma_parser_start;
}
-#line 87 "ext/puma_http11/http11_parser.rl"
+#line 89 "ext/puma_http11/http11_parser.rl"
parser->cs = cs;
parser->body_start = 0;
parser->content_len = 0;
parser->mark = 0;
parser->nread = 0;
@@ -107,34 +105,34 @@
goto st0;
st0:
cs = 0;
goto _out;
tr0:
-#line 35 "ext/puma_http11/http11_parser.rl"
+#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st2;
st2:
if ( ++p == pe )
goto _test_eof2;
case 2:
#line 118 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr2;
- case 36: goto st28;
- case 95: goto st28;
+ case 36: goto st27;
+ case 95: goto st27;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
- goto st28;
+ goto st27;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
- goto st28;
+ goto st27;
} else
- goto st28;
+ goto st27;
goto st0;
tr2:
-#line 48 "ext/puma_http11/http11_parser.rl"
+#line 50 "ext/puma_http11/http11_parser.rl"
{
parser->request_method(parser, PTR_TO(mark), LEN(mark, p));
}
goto st3;
st3:
@@ -156,11 +154,11 @@
goto tr5;
} else
goto tr5;
goto st0;
tr4:
-#line 35 "ext/puma_http11/http11_parser.rl"
+#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st4;
st4:
if ( ++p == pe )
goto _test_eof4;
@@ -170,57 +168,57 @@
case 32: goto tr8;
case 35: goto tr9;
}
goto st0;
tr8:
-#line 51 "ext/puma_http11/http11_parser.rl"
+#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr31:
-#line 35 "ext/puma_http11/http11_parser.rl"
+#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
-#line 54 "ext/puma_http11/http11_parser.rl"
+#line 56 "ext/puma_http11/http11_parser.rl"
{
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr33:
-#line 54 "ext/puma_http11/http11_parser.rl"
+#line 56 "ext/puma_http11/http11_parser.rl"
{
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr37:
-#line 67 "ext/puma_http11/http11_parser.rl"
+#line 69 "ext/puma_http11/http11_parser.rl"
{
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
}
-#line 51 "ext/puma_http11/http11_parser.rl"
+#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
-tr44:
-#line 58 "ext/puma_http11/http11_parser.rl"
+tr41:
+#line 60 "ext/puma_http11/http11_parser.rl"
{ MARK(query_start, p); }
-#line 59 "ext/puma_http11/http11_parser.rl"
+#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
-#line 51 "ext/puma_http11/http11_parser.rl"
+#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
-tr47:
-#line 59 "ext/puma_http11/http11_parser.rl"
+tr44:
+#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
-#line 51 "ext/puma_http11/http11_parser.rl"
+#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
st5:
@@ -230,11 +228,11 @@
#line 229 "ext/puma_http11/http11_parser.c"
if ( (*p) == 72 )
goto tr10;
goto st0;
tr10:
-#line 35 "ext/puma_http11/http11_parser.rl"
+#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st6;
st6:
if ( ++p == pe )
goto _test_eof6;
@@ -295,25 +293,25 @@
goto tr18;
if ( 48 <= (*p) && (*p) <= 57 )
goto st13;
goto st0;
tr18:
-#line 63 "ext/puma_http11/http11_parser.rl"
+#line 65 "ext/puma_http11/http11_parser.rl"
{
parser->http_version(parser, PTR_TO(mark), LEN(mark, p));
}
goto st14;
tr26:
-#line 44 "ext/puma_http11/http11_parser.rl"
+#line 46 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
-#line 45 "ext/puma_http11/http11_parser.rl"
+#line 47 "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 45 "ext/puma_http11/http11_parser.rl"
+#line 47 "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;
st14:
@@ -358,31 +356,31 @@
case 16:
if ( (*p) == 10 )
goto tr22;
goto st0;
tr22:
-#line 71 "ext/puma_http11/http11_parser.rl"
+#line 73 "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;}
+ {p++; cs = 46; goto _out;}
}
- goto st47;
-st47:
+ goto st46;
+st46:
if ( ++p == pe )
- goto _test_eof47;
-case 47:
+ goto _test_eof46;
+case 46:
#line 373 "ext/puma_http11/http11_parser.c"
goto st0;
tr21:
-#line 38 "ext/puma_http11/http11_parser.rl"
+#line 40 "ext/puma_http11/http11_parser.rl"
{ MARK(field_start, p); }
-#line 39 "ext/puma_http11/http11_parser.rl"
+#line 41 "ext/puma_http11/http11_parser.rl"
{ snake_upcase_char((char *)p); }
goto st17;
tr23:
-#line 39 "ext/puma_http11/http11_parser.rl"
+#line 41 "ext/puma_http11/http11_parser.rl"
{ snake_upcase_char((char *)p); }
goto st17;
st17:
if ( ++p == pe )
goto _test_eof17;
@@ -411,17 +409,17 @@
goto tr23;
} else
goto tr23;
goto st0;
tr24:
-#line 40 "ext/puma_http11/http11_parser.rl"
+#line 42 "ext/puma_http11/http11_parser.rl"
{
parser->field_len = LEN(field_start, p);
}
goto st18;
tr27:
-#line 44 "ext/puma_http11/http11_parser.rl"
+#line 46 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st18;
st18:
if ( ++p == pe )
goto _test_eof18;
@@ -431,11 +429,11 @@
case 13: goto tr26;
case 32: goto tr27;
}
goto tr25;
tr25:
-#line 44 "ext/puma_http11/http11_parser.rl"
+#line 46 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st19;
st19:
if ( ++p == pe )
goto _test_eof19;
@@ -443,43 +441,43 @@
#line 442 "ext/puma_http11/http11_parser.c"
if ( (*p) == 13 )
goto tr29;
goto st19;
tr9:
-#line 51 "ext/puma_http11/http11_parser.rl"
+#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
tr38:
-#line 67 "ext/puma_http11/http11_parser.rl"
+#line 69 "ext/puma_http11/http11_parser.rl"
{
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
}
-#line 51 "ext/puma_http11/http11_parser.rl"
+#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
-tr45:
-#line 58 "ext/puma_http11/http11_parser.rl"
+tr42:
+#line 60 "ext/puma_http11/http11_parser.rl"
{ MARK(query_start, p); }
-#line 59 "ext/puma_http11/http11_parser.rl"
+#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
-#line 51 "ext/puma_http11/http11_parser.rl"
+#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
-tr48:
-#line 59 "ext/puma_http11/http11_parser.rl"
+tr45:
+#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
-#line 51 "ext/puma_http11/http11_parser.rl"
+#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
st20:
@@ -498,11 +496,11 @@
goto st0;
} else if ( (*p) >= 0 )
goto st0;
goto tr30;
tr30:
-#line 35 "ext/puma_http11/http11_parser.rl"
+#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st21;
st21:
if ( ++p == pe )
goto _test_eof21;
@@ -519,11 +517,11 @@
goto st0;
} else if ( (*p) >= 0 )
goto st0;
goto st21;
tr5:
-#line 35 "ext/puma_http11/http11_parser.rl"
+#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st22;
st22:
if ( ++p == pe )
goto _test_eof22;
@@ -544,11 +542,11 @@
goto st22;
} else
goto st22;
goto st0;
tr7:
-#line 35 "ext/puma_http11/http11_parser.rl"
+#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st23;
st23:
if ( ++p == pe )
goto _test_eof23;
@@ -564,11 +562,11 @@
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
goto st23;
tr6:
-#line 35 "ext/puma_http11/http11_parser.rl"
+#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st24;
st24:
if ( ++p == pe )
goto _test_eof24;
@@ -576,84 +574,78 @@
#line 575 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr37;
case 34: goto st0;
case 35: goto tr38;
- case 59: goto tr39;
case 60: goto st0;
case 62: goto st0;
- case 63: goto tr40;
+ case 63: goto tr39;
case 127: goto st0;
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
goto st24;
tr39:
-#line 67 "ext/puma_http11/http11_parser.rl"
+#line 69 "ext/puma_http11/http11_parser.rl"
{
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
}
goto st25;
st25:
if ( ++p == pe )
goto _test_eof25;
case 25:
-#line 599 "ext/puma_http11/http11_parser.c"
+#line 598 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
- case 32: goto tr8;
+ case 32: goto tr41;
case 34: goto st0;
- case 35: goto tr9;
+ case 35: goto tr42;
case 60: goto st0;
case 62: goto st0;
- case 63: goto st26;
case 127: goto st0;
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
- goto st25;
+ goto tr40;
tr40:
-#line 67 "ext/puma_http11/http11_parser.rl"
- {
- parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
- }
+#line 60 "ext/puma_http11/http11_parser.rl"
+ { MARK(query_start, p); }
goto st26;
st26:
if ( ++p == pe )
goto _test_eof26;
case 26:
-#line 622 "ext/puma_http11/http11_parser.c"
+#line 618 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr44;
case 34: goto st0;
case 35: goto tr45;
case 60: goto st0;
case 62: goto st0;
case 127: goto st0;
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
- goto tr43;
-tr43:
-#line 58 "ext/puma_http11/http11_parser.rl"
- { MARK(query_start, p); }
- goto st27;
+ goto st26;
st27:
if ( ++p == pe )
goto _test_eof27;
case 27:
-#line 642 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
- case 32: goto tr47;
- case 34: goto st0;
- case 35: goto tr48;
- case 60: goto st0;
- case 62: goto st0;
- case 127: goto st0;
+ case 32: goto tr2;
+ case 36: goto st28;
+ case 95: goto st28;
}
- if ( 0 <= (*p) && (*p) <= 31 )
- goto st0;
- goto st27;
+ if ( (*p) < 48 ) {
+ if ( 45 <= (*p) && (*p) <= 46 )
+ goto st28;
+ } else if ( (*p) > 57 ) {
+ if ( 65 <= (*p) && (*p) <= 90 )
+ goto st28;
+ } else
+ goto st28;
+ goto st0;
st28:
if ( ++p == pe )
goto _test_eof28;
case 28:
switch( (*p) ) {
@@ -960,28 +952,10 @@
goto st0;
st45:
if ( ++p == pe )
goto _test_eof45;
case 45:
- switch( (*p) ) {
- case 32: goto tr2;
- case 36: goto st46;
- case 95: goto st46;
- }
- if ( (*p) < 48 ) {
- if ( 45 <= (*p) && (*p) <= 46 )
- goto st46;
- } else if ( (*p) > 57 ) {
- if ( 65 <= (*p) && (*p) <= 90 )
- goto st46;
- } else
- goto st46;
- goto st0;
-st46:
- if ( ++p == pe )
- goto _test_eof46;
-case 46:
if ( (*p) == 32 )
goto tr2;
goto st0;
}
_test_eof2: cs = 2; goto _test_eof;
@@ -997,11 +971,11 @@
_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_eof46: cs = 46; 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;
@@ -1027,16 +1001,15 @@
_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 115 "ext/puma_http11/http11_parser.rl"
+#line 117 "ext/puma_http11/http11_parser.rl"
if (!puma_parser_has_error(parser))
parser->cs = cs;
parser->nread += p - (buffer + off);