diff --git a/ext/puma_http11/http11_parser.c b/ext/puma_http11/http11_parser.c index 725eb908b4..3398b7bab4 100644 --- a/ext/puma_http11/http11_parser.c +++ b/ext/puma_http11/http11_parser.c @@ -41,14 +41,11 @@ 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" int puma_parser_init(puma_parser *parser) { int cs = 0; - + #line 52 "ext/puma_http11/http11_parser.c" { cs = puma_parser_start; @@ -82,7 +79,7 @@ size_t puma_parser_execute(puma_parser *parser, const char *buffer, size_t 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" { if ( p == pe ) @@ -131,7 +128,7 @@ case 2: goto st0; tr2: #line 47 "ext/puma_http11/http11_parser.rl" - { + { parser->request_method(parser, PTR_TO(mark), LEN(mark, p)); } goto st3; @@ -171,7 +168,7 @@ case 4: goto st0; tr8: #line 50 "ext/puma_http11/http11_parser.rl" - { + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st5; @@ -195,7 +192,7 @@ case 4: parser->request_path(parser, PTR_TO(mark), LEN(mark,p)); } #line 50 "ext/puma_http11/http11_parser.rl" - { + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st5; @@ -203,21 +200,21 @@ case 4: #line 57 "ext/puma_http11/http11_parser.rl" { MARK(query_start, p); } #line 58 "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" - { + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st5; tr47: #line 58 "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" - { + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st5; @@ -296,7 +293,7 @@ case 13: goto st0; tr18: #line 62 "ext/puma_http11/http11_parser.rl" - { + { parser->http_version(parser, PTR_TO(mark), LEN(mark, p)); } goto st14; @@ -359,8 +356,8 @@ case 16: goto st0; tr22: #line 70 "ext/puma_http11/http11_parser.rl" - { - parser->body_start = p - buffer + 1; + { + parser->body_start = p - buffer + 1; parser->header_done(parser, p + 1, pe - p - 1); {p++; cs = 47; goto _out;} } @@ -412,7 +409,7 @@ case 17: goto st0; tr24: #line 39 "ext/puma_http11/http11_parser.rl" - { + { parser->field_len = LEN(field_start, p); } goto st18; @@ -444,7 +441,7 @@ case 19: goto st19; tr9: #line 50 "ext/puma_http11/http11_parser.rl" - { + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st20; @@ -454,7 +451,7 @@ case 19: parser->request_path(parser, PTR_TO(mark), LEN(mark,p)); } #line 50 "ext/puma_http11/http11_parser.rl" - { + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st20; @@ -462,21 +459,21 @@ case 19: #line 57 "ext/puma_http11/http11_parser.rl" { MARK(query_start, p); } #line 58 "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" - { + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st20; tr48: #line 58 "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" - { + { parser->request_uri(parser, PTR_TO(mark), LEN(mark, p)); } goto st20; @@ -982,52 +979,52 @@ 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: {} 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";