puma 3.4.0 → 3.12.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puma might be problematic. Click here for more details.

Files changed (71) hide show
  1. checksums.yaml +5 -5
  2. data/{History.txt → History.md} +356 -74
  3. data/README.md +143 -227
  4. data/docs/architecture.md +36 -0
  5. data/{DEPLOYMENT.md → docs/deployment.md} +1 -1
  6. data/docs/images/puma-connection-flow-no-reactor.png +0 -0
  7. data/docs/images/puma-connection-flow.png +0 -0
  8. data/docs/images/puma-general-arch.png +0 -0
  9. data/docs/plugins.md +28 -0
  10. data/docs/restart.md +39 -0
  11. data/docs/signals.md +56 -3
  12. data/docs/systemd.md +124 -22
  13. data/ext/puma_http11/extconf.rb +2 -0
  14. data/ext/puma_http11/http11_parser.c +291 -447
  15. data/ext/puma_http11/http11_parser.h +1 -0
  16. data/ext/puma_http11/http11_parser.rl +10 -9
  17. data/ext/puma_http11/http11_parser_common.rl +1 -1
  18. data/ext/puma_http11/io_buffer.c +7 -7
  19. data/ext/puma_http11/mini_ssl.c +67 -6
  20. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +76 -94
  21. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +15 -2
  22. data/ext/puma_http11/puma_http11.c +1 -0
  23. data/lib/puma.rb +13 -5
  24. data/lib/puma/app/status.rb +8 -0
  25. data/lib/puma/binder.rb +46 -21
  26. data/lib/puma/cli.rb +49 -33
  27. data/lib/puma/client.rb +149 -4
  28. data/lib/puma/cluster.rb +55 -13
  29. data/lib/puma/commonlogger.rb +19 -20
  30. data/lib/puma/compat.rb +3 -7
  31. data/lib/puma/configuration.rb +136 -131
  32. data/lib/puma/const.rb +19 -37
  33. data/lib/puma/control_cli.rb +38 -35
  34. data/lib/puma/convenient.rb +3 -3
  35. data/lib/puma/detect.rb +3 -1
  36. data/lib/puma/dsl.rb +86 -57
  37. data/lib/puma/events.rb +17 -13
  38. data/lib/puma/io_buffer.rb +1 -1
  39. data/lib/puma/jruby_restart.rb +0 -1
  40. data/lib/puma/launcher.rb +61 -30
  41. data/lib/puma/minissl.rb +85 -4
  42. data/lib/puma/null_io.rb +6 -13
  43. data/lib/puma/plugin.rb +12 -1
  44. data/lib/puma/plugin/tmp_restart.rb +1 -2
  45. data/lib/puma/rack/builder.rb +3 -0
  46. data/lib/puma/rack/urlmap.rb +9 -8
  47. data/lib/puma/reactor.rb +144 -0
  48. data/lib/puma/runner.rb +27 -1
  49. data/lib/puma/server.rb +135 -33
  50. data/lib/puma/single.rb +17 -3
  51. data/lib/puma/tcp_logger.rb +8 -1
  52. data/lib/puma/thread_pool.rb +70 -20
  53. data/lib/puma/util.rb +1 -5
  54. data/lib/rack/handler/puma.rb +58 -17
  55. data/tools/jungle/README.md +12 -2
  56. data/tools/jungle/init.d/README.md +9 -2
  57. data/tools/jungle/init.d/puma +85 -58
  58. data/tools/jungle/init.d/run-puma +16 -1
  59. data/tools/jungle/rc.d/README.md +74 -0
  60. data/tools/jungle/rc.d/puma +61 -0
  61. data/tools/jungle/rc.d/puma.conf +10 -0
  62. data/tools/jungle/upstart/puma.conf +1 -1
  63. data/tools/trickletest.rb +1 -1
  64. metadata +22 -94
  65. data/Gemfile +0 -13
  66. data/Manifest.txt +0 -78
  67. data/Rakefile +0 -158
  68. data/docs/config.md +0 -0
  69. data/lib/puma/rack/backports/uri/common_18.rb +0 -59
  70. data/lib/puma/rack/backports/uri/common_192.rb +0 -55
  71. data/puma.gemspec +0 -52
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2005 Zed A. Shaw
3
3
  * You can redistribute it and/or modify it under the same terms as Ruby.
4
+ * License 3-clause BSD
4
5
  */
5
6
 
6
7
  #ifndef http11_parser_h
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2005 Zed A. Shaw
3
3
  * You can redistribute it and/or modify it under the same terms as Ruby.
4
+ * License 3-clause BSD
4
5
  */
5
6
  #include "http11_parser.h"
6
7
  #include <stdio.h>
@@ -28,7 +29,7 @@ static void snake_upcase_char(char *c)
28
29
  /** Machine **/
29
30
 
30
31
  %%{
31
-
32
+
32
33
  machine puma_parser;
33
34
 
34
35
  action mark { MARK(mark, fpc); }
@@ -36,7 +37,7 @@ static void snake_upcase_char(char *c)
36
37
 
37
38
  action start_field { MARK(field_start, fpc); }
38
39
  action snake_upcase_field { snake_upcase_char((char *)fpc); }
39
- action write_field {
40
+ action write_field {
40
41
  parser->field_len = LEN(field_start, fpc);
41
42
  }
42
43
 
@@ -44,10 +45,10 @@ static void snake_upcase_char(char *c)
44
45
  action write_value {
45
46
  parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, fpc));
46
47
  }
47
- action request_method {
48
+ action request_method {
48
49
  parser->request_method(parser, PTR_TO(mark), LEN(mark, fpc));
49
50
  }
50
- action request_uri {
51
+ action request_uri {
51
52
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, fpc));
52
53
  }
53
54
  action fragment {
@@ -55,11 +56,11 @@ static void snake_upcase_char(char *c)
55
56
  }
56
57
 
57
58
  action start_query { MARK(query_start, fpc); }
58
- action query_string {
59
+ action query_string {
59
60
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, fpc));
60
61
  }
61
62
 
62
- action http_version {
63
+ action http_version {
63
64
  parser->http_version(parser, PTR_TO(mark), LEN(mark, fpc));
64
65
  }
65
66
 
@@ -67,8 +68,8 @@ static void snake_upcase_char(char *c)
67
68
  parser->request_path(parser, PTR_TO(mark), LEN(mark,fpc));
68
69
  }
69
70
 
70
- action done {
71
- parser->body_start = fpc - buffer + 1;
71
+ action done {
72
+ parser->body_start = fpc - buffer + 1;
72
73
  parser->header_done(parser, fpc + 1, pe - fpc - 1);
73
74
  fbreak;
74
75
  }
@@ -108,7 +109,7 @@ size_t puma_parser_execute(puma_parser *parser, const char *buffer, size_t len,
108
109
  pe = buffer+len;
109
110
 
110
111
  /* assert(*pe == '\0' && "pointer does not end on NUL"); */
111
- assert(pe - p == len - off && "pointers aren't same distance");
112
+ assert((size_t) (pe - p) == len - off && "pointers aren't same distance");
112
113
 
113
114
  %% write exec;
114
115
 
@@ -15,7 +15,7 @@
15
15
  national = any -- (alpha | digit | reserved | extra | safe | unsafe);
16
16
  unreserved = (alpha | digit | safe | extra | national);
17
17
  escape = ("%" xdigit xdigit);
18
- uchar = (unreserved | escape);
18
+ uchar = (unreserved | escape | "%");
19
19
  pchar = (uchar | ":" | "@" | "&" | "=" | "+");
20
20
  tspecials = ("(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\\" | "\"" | "/" | "[" | "]" | "?" | "=" | "{" | "}" | " " | "\t");
21
21
 
@@ -14,8 +14,8 @@ struct buf_int {
14
14
  #define BUF_TOLERANCE 32
15
15
 
16
16
  static void buf_free(struct buf_int* internal) {
17
- free(internal->top);
18
- free(internal);
17
+ xfree(internal->top);
18
+ xfree(internal);
19
19
  }
20
20
 
21
21
  static VALUE buf_alloc(VALUE self) {
@@ -25,7 +25,7 @@ static VALUE buf_alloc(VALUE self) {
25
25
  buf = Data_Make_Struct(self, struct buf_int, 0, buf_free, internal);
26
26
 
27
27
  internal->size = BUF_DEFAULT_SIZE;
28
- internal->top = malloc(BUF_DEFAULT_SIZE);
28
+ internal->top = ALLOC_N(uint8_t, BUF_DEFAULT_SIZE);
29
29
  internal->cur = internal->top;
30
30
 
31
31
  return buf;
@@ -51,13 +51,13 @@ static VALUE buf_append(VALUE self, VALUE str) {
51
51
 
52
52
  new_size = (n > new_size ? n : new_size + BUF_TOLERANCE);
53
53
 
54
- top = malloc(new_size);
54
+ top = ALLOC_N(uint8_t, new_size);
55
55
  old = b->top;
56
56
  memcpy(top, old, used);
57
57
  b->top = top;
58
58
  b->cur = top + used;
59
59
  b->size = new_size;
60
- free(old);
60
+ xfree(old);
61
61
  }
62
62
 
63
63
  memcpy(b->cur, RSTRING_PTR(str), str_len);
@@ -92,13 +92,13 @@ static VALUE buf_append2(int argc, VALUE* argv, VALUE self) {
92
92
 
93
93
  new_size = (n > new_size ? n : new_size + BUF_TOLERANCE);
94
94
 
95
- top = malloc(new_size);
95
+ top = ALLOC_N(uint8_t, new_size);
96
96
  old = b->top;
97
97
  memcpy(top, old, used);
98
98
  b->top = top;
99
99
  b->cur = top + used;
100
100
  b->size = new_size;
101
- free(old);
101
+ xfree(old);
102
102
  }
103
103
 
104
104
  for(i = 0; i < argc; i++) {
@@ -87,6 +87,8 @@ DH *get_dh1024() {
87
87
 
88
88
  DH *dh;
89
89
  dh = DH_new();
90
+
91
+ #if OPENSSL_VERSION_NUMBER < 0x10100005L || defined(LIBRESSL_VERSION_NUMBER)
90
92
  dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
91
93
  dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
92
94
 
@@ -94,6 +96,18 @@ DH *get_dh1024() {
94
96
  DH_free(dh);
95
97
  return NULL;
96
98
  }
99
+ #else
100
+ BIGNUM *p, *g;
101
+ p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
102
+ g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
103
+
104
+ if (p == NULL || g == NULL || !DH_set0_pqg(dh, p, NULL, g)) {
105
+ DH_free(dh);
106
+ BN_free(p);
107
+ BN_free(g);
108
+ return NULL;
109
+ }
110
+ #endif
97
111
 
98
112
  return dh;
99
113
  }
@@ -134,15 +148,22 @@ VALUE engine_init_server(VALUE self, VALUE mini_ssl_ctx) {
134
148
  ID sym_key = rb_intern("key");
135
149
  VALUE key = rb_funcall(mini_ssl_ctx, sym_key, 0);
136
150
 
151
+ StringValue(key);
152
+
137
153
  ID sym_cert = rb_intern("cert");
138
154
  VALUE cert = rb_funcall(mini_ssl_ctx, sym_cert, 0);
139
155
 
156
+ StringValue(cert);
157
+
140
158
  ID sym_ca = rb_intern("ca");
141
159
  VALUE ca = rb_funcall(mini_ssl_ctx, sym_ca, 0);
142
160
 
143
161
  ID sym_verify_mode = rb_intern("verify_mode");
144
162
  VALUE verify_mode = rb_funcall(mini_ssl_ctx, sym_verify_mode, 0);
145
163
 
164
+ ID sym_ssl_cipher_filter = rb_intern("ssl_cipher_filter");
165
+ VALUE ssl_cipher_filter = rb_funcall(mini_ssl_ctx, sym_ssl_cipher_filter, 0);
166
+
146
167
  ctx = SSL_CTX_new(SSLv23_server_method());
147
168
  conn->ctx = ctx;
148
169
 
@@ -150,13 +171,20 @@ VALUE engine_init_server(VALUE self, VALUE mini_ssl_ctx) {
150
171
  SSL_CTX_use_PrivateKey_file(ctx, RSTRING_PTR(key), SSL_FILETYPE_PEM);
151
172
 
152
173
  if (!NIL_P(ca)) {
174
+ StringValue(ca);
153
175
  SSL_CTX_load_verify_locations(ctx, RSTRING_PTR(ca), NULL);
154
176
  }
155
-
177
+
156
178
  SSL_CTX_set_options(ctx, SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_SINGLE_DH_USE | SSL_OP_SINGLE_ECDH_USE | SSL_OP_NO_COMPRESSION);
157
179
  SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
158
180
 
159
- SSL_CTX_set_cipher_list(ctx, "HIGH:!aNULL@STRENGTH");
181
+ if (!NIL_P(ssl_cipher_filter)) {
182
+ StringValue(ssl_cipher_filter);
183
+ SSL_CTX_set_cipher_list(ctx, RSTRING_PTR(ssl_cipher_filter));
184
+ }
185
+ else {
186
+ SSL_CTX_set_cipher_list(ctx, "HIGH:!aNULL@STRENGTH");
187
+ }
160
188
 
161
189
  DH *dh = get_dh1024();
162
190
  SSL_CTX_set_tmp_dh(ctx, dh);
@@ -225,7 +253,7 @@ void raise_error(SSL* ssl, int result) {
225
253
  const char* err_str;
226
254
  int err = errno;
227
255
  int ssl_err = SSL_get_error(ssl, result);
228
- int verify_err = SSL_get_verify_result(ssl);
256
+ int verify_err = (int) SSL_get_verify_result(ssl);
229
257
 
230
258
  if(SSL_ERROR_SYSCALL == ssl_err) {
231
259
  snprintf(msg, sizeof(msg), "System error: %s - %d", strerror(err), err);
@@ -238,7 +266,7 @@ void raise_error(SSL* ssl, int result) {
238
266
  err_str, verify_err);
239
267
 
240
268
  } else {
241
- err = ERR_get_error();
269
+ err = (int) ERR_get_error();
242
270
  ERR_error_string_n(err, buf, sizeof(buf));
243
271
  snprintf(msg, sizeof(msg), "OpenSSL error: %s - %d", buf, err);
244
272
 
@@ -322,6 +350,30 @@ VALUE engine_extract(VALUE self) {
322
350
  return Qnil;
323
351
  }
324
352
 
353
+ VALUE engine_shutdown(VALUE self) {
354
+ ms_conn* conn;
355
+ int ok;
356
+
357
+ Data_Get_Struct(self, ms_conn, conn);
358
+
359
+ ERR_clear_error();
360
+
361
+ ok = SSL_shutdown(conn->ssl);
362
+ if (ok == 0) {
363
+ return Qfalse;
364
+ }
365
+
366
+ return Qtrue;
367
+ }
368
+
369
+ VALUE engine_init(VALUE self) {
370
+ ms_conn* conn;
371
+
372
+ Data_Get_Struct(self, ms_conn, conn);
373
+
374
+ return SSL_in_init(conn->ssl) ? Qtrue : Qfalse;
375
+ }
376
+
325
377
  VALUE engine_peercert(VALUE self) {
326
378
  ms_conn* conn;
327
379
  X509* cert;
@@ -368,11 +420,16 @@ VALUE noop(VALUE self) {
368
420
  void Init_mini_ssl(VALUE puma) {
369
421
  VALUE mod, eng;
370
422
 
423
+ /* Fake operation for documentation (RDoc, YARD) */
424
+ #if 0 == 1
425
+ puma = rb_define_module("Puma");
426
+ #endif
427
+
371
428
  SSL_library_init();
372
429
  OpenSSL_add_ssl_algorithms();
373
430
  SSL_load_error_strings();
374
431
  ERR_load_crypto_strings();
375
-
432
+
376
433
  mod = rb_define_module_under(puma, "MiniSSL");
377
434
  eng = rb_define_class_under(mod, "Engine", rb_cObject);
378
435
 
@@ -389,6 +446,10 @@ void Init_mini_ssl(VALUE puma) {
389
446
  rb_define_method(eng, "write", engine_write, 1);
390
447
  rb_define_method(eng, "extract", engine_extract, 0);
391
448
 
449
+ rb_define_method(eng, "shutdown", engine_shutdown, 0);
450
+
451
+ rb_define_method(eng, "init?", engine_init, 0);
452
+
392
453
  rb_define_method(eng, "peercert", engine_peercert, 0);
393
454
  }
394
455
 
@@ -400,7 +461,7 @@ VALUE raise_error(VALUE self) {
400
461
  }
401
462
 
402
463
  void Init_mini_ssl(VALUE puma) {
403
- VALUE mod, eng;
464
+ VALUE mod;
404
465
 
405
466
  mod = rb_define_module_under(puma, "MiniSSL");
406
467
  rb_define_class_under(mod, "SSLError", rb_eStandardError);
@@ -32,10 +32,9 @@ private static short[] init__puma_parser_key_offsets_0()
32
32
  {
33
33
  return new short [] {
34
34
  0, 0, 8, 17, 27, 29, 30, 31, 32, 33, 34, 36,
35
- 39, 41, 44, 45, 61, 62, 78, 80, 81, 90, 99, 105,
36
- 111, 121, 130, 136, 142, 153, 159, 165, 175, 181, 187, 196,
37
- 205, 211, 217, 226, 235, 244, 253, 262, 271, 280, 289, 298,
38
- 307, 316, 325, 334, 343, 352, 361, 370, 379, 380
35
+ 39, 41, 44, 45, 61, 62, 78, 80, 81, 89, 97, 107,
36
+ 115, 125, 134, 142, 150, 159, 168, 177, 186, 195, 204, 213,
37
+ 222, 231, 240, 249, 258, 267, 276, 285, 294, 303, 312, 313
39
38
  };
40
39
  }
41
40
 
@@ -51,32 +50,27 @@ private static char[] init__puma_parser_trans_keys_0()
51
50
  46, 48, 57, 48, 57, 13, 48, 57, 10, 13, 33, 124,
52
51
  126, 35, 39, 42, 43, 45, 46, 48, 57, 65, 90, 94,
53
52
  122, 10, 33, 58, 124, 126, 35, 39, 42, 43, 45, 46,
54
- 48, 57, 65, 90, 94, 122, 13, 32, 13, 32, 37, 60,
55
- 62, 127, 0, 31, 34, 35, 32, 37, 60, 62, 127, 0,
56
- 31, 34, 35, 48, 57, 65, 70, 97, 102, 48, 57, 65,
57
- 70, 97, 102, 43, 58, 45, 46, 48, 57, 65, 90, 97,
58
- 122, 32, 34, 35, 37, 60, 62, 127, 0, 31, 48, 57,
59
- 65, 70, 97, 102, 48, 57, 65, 70, 97, 102, 32, 34,
60
- 35, 37, 59, 60, 62, 63, 127, 0, 31, 48, 57, 65,
61
- 70, 97, 102, 48, 57, 65, 70, 97, 102, 32, 34, 35,
62
- 37, 60, 62, 63, 127, 0, 31, 48, 57, 65, 70, 97,
63
- 102, 48, 57, 65, 70, 97, 102, 32, 34, 35, 37, 60,
64
- 62, 127, 0, 31, 32, 34, 35, 37, 60, 62, 127, 0,
65
- 31, 48, 57, 65, 70, 97, 102, 48, 57, 65, 70, 97,
66
- 102, 32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36,
67
- 95, 45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46,
68
- 48, 57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65,
69
- 90, 32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36,
70
- 95, 45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46,
71
- 48, 57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65,
72
- 90, 32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36,
73
- 95, 45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46,
74
- 48, 57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65,
75
- 90, 32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36,
76
- 95, 45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46,
77
- 48, 57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65,
78
- 90, 32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36,
79
- 95, 45, 46, 48, 57, 65, 90, 32, 0
53
+ 48, 57, 65, 90, 94, 122, 13, 32, 13, 32, 60, 62,
54
+ 127, 0, 31, 34, 35, 32, 60, 62, 127, 0, 31, 34,
55
+ 35, 43, 58, 45, 46, 48, 57, 65, 90, 97, 122, 32,
56
+ 34, 35, 60, 62, 127, 0, 31, 32, 34, 35, 59, 60,
57
+ 62, 63, 127, 0, 31, 32, 34, 35, 60, 62, 63, 127,
58
+ 0, 31, 32, 34, 35, 60, 62, 127, 0, 31, 32, 34,
59
+ 35, 60, 62, 127, 0, 31, 32, 36, 95, 45, 46, 48,
60
+ 57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65, 90,
61
+ 32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36, 95,
62
+ 45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46, 48,
63
+ 57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65, 90,
64
+ 32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36, 95,
65
+ 45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46, 48,
66
+ 57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65, 90,
67
+ 32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36, 95,
68
+ 45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46, 48,
69
+ 57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65, 90,
70
+ 32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36, 95,
71
+ 45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46, 48,
72
+ 57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65, 90,
73
+ 32, 0
80
74
  };
81
75
  }
82
76
 
@@ -87,10 +81,9 @@ private static byte[] init__puma_parser_single_lengths_0()
87
81
  {
88
82
  return new byte [] {
89
83
  0, 2, 3, 4, 2, 1, 1, 1, 1, 1, 0, 1,
90
- 0, 1, 1, 4, 1, 4, 2, 1, 5, 5, 0, 0,
91
- 2, 7, 0, 0, 9, 0, 0, 8, 0, 0, 7, 7,
92
- 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
93
- 3, 3, 3, 3, 3, 3, 3, 3, 1, 0
84
+ 0, 1, 1, 4, 1, 4, 2, 1, 4, 4, 2, 6,
85
+ 8, 7, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3,
86
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 0
94
87
  };
95
88
  }
96
89
 
@@ -101,10 +94,9 @@ private static byte[] init__puma_parser_range_lengths_0()
101
94
  {
102
95
  return new byte [] {
103
96
  0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 1, 1,
104
- 1, 1, 0, 6, 0, 6, 0, 0, 2, 2, 3, 3,
105
- 4, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 1,
106
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
107
- 3, 3, 3, 3, 3, 3, 3, 3, 0, 0
97
+ 1, 1, 0, 6, 0, 6, 0, 0, 2, 2, 4, 1,
98
+ 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
99
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0
108
100
  };
109
101
  }
110
102
 
@@ -115,10 +107,9 @@ private static short[] init__puma_parser_index_offsets_0()
115
107
  {
116
108
  return new short [] {
117
109
  0, 0, 6, 13, 21, 24, 26, 28, 30, 32, 34, 36,
118
- 39, 41, 44, 46, 57, 59, 70, 73, 75, 83, 91, 95,
119
- 99, 106, 115, 119, 123, 134, 138, 142, 152, 156, 160, 169,
120
- 178, 182, 186, 193, 200, 207, 214, 221, 228, 235, 242, 249,
121
- 256, 263, 270, 277, 284, 291, 298, 305, 312, 314
110
+ 39, 41, 44, 46, 57, 59, 70, 73, 75, 82, 89, 96,
111
+ 104, 114, 123, 131, 139, 146, 153, 160, 167, 174, 181, 188,
112
+ 195, 202, 209, 216, 223, 230, 237, 244, 251, 258, 265, 267
122
113
  };
123
114
  }
124
115
 
@@ -134,27 +125,23 @@ private static byte[] init__puma_parser_indicies_0()
134
125
  16, 15, 1, 17, 1, 18, 17, 1, 19, 1, 20, 21,
135
126
  21, 21, 21, 21, 21, 21, 21, 21, 1, 22, 1, 23,
136
127
  24, 23, 23, 23, 23, 23, 23, 23, 23, 1, 26, 27,
137
- 25, 29, 28, 30, 32, 1, 1, 1, 1, 1, 31, 33,
138
- 35, 1, 1, 1, 1, 1, 34, 36, 36, 36, 1, 34,
139
- 34, 34, 1, 37, 38, 37, 37, 37, 37, 1, 8, 1,
140
- 9, 39, 1, 1, 1, 1, 38, 40, 40, 40, 1, 38,
141
- 38, 38, 1, 41, 1, 43, 44, 45, 1, 1, 46, 1,
142
- 1, 42, 47, 47, 47, 1, 42, 42, 42, 1, 8, 1,
143
- 9, 49, 1, 1, 50, 1, 1, 48, 51, 51, 51, 1,
144
- 48, 48, 48, 1, 52, 1, 54, 55, 1, 1, 1, 1,
145
- 53, 56, 1, 58, 59, 1, 1, 1, 1, 57, 60, 60,
146
- 60, 1, 57, 57, 57, 1, 2, 61, 61, 61, 61, 61,
147
- 1, 2, 62, 62, 62, 62, 62, 1, 2, 63, 63, 63,
148
- 63, 63, 1, 2, 64, 64, 64, 64, 64, 1, 2, 65,
149
- 65, 65, 65, 65, 1, 2, 66, 66, 66, 66, 66, 1,
150
- 2, 67, 67, 67, 67, 67, 1, 2, 68, 68, 68, 68,
151
- 68, 1, 2, 69, 69, 69, 69, 69, 1, 2, 70, 70,
152
- 70, 70, 70, 1, 2, 71, 71, 71, 71, 71, 1, 2,
153
- 72, 72, 72, 72, 72, 1, 2, 73, 73, 73, 73, 73,
154
- 1, 2, 74, 74, 74, 74, 74, 1, 2, 75, 75, 75,
155
- 75, 75, 1, 2, 76, 76, 76, 76, 76, 1, 2, 77,
156
- 77, 77, 77, 77, 1, 2, 78, 78, 78, 78, 78, 1,
157
- 2, 1, 1, 0
128
+ 25, 29, 28, 30, 1, 1, 1, 1, 1, 31, 32, 1,
129
+ 1, 1, 1, 1, 33, 34, 35, 34, 34, 34, 34, 1,
130
+ 8, 1, 9, 1, 1, 1, 1, 35, 36, 1, 38, 39,
131
+ 1, 1, 40, 1, 1, 37, 8, 1, 9, 1, 1, 42,
132
+ 1, 1, 41, 43, 1, 45, 1, 1, 1, 1, 44, 46,
133
+ 1, 48, 1, 1, 1, 1, 47, 2, 49, 49, 49, 49,
134
+ 49, 1, 2, 50, 50, 50, 50, 50, 1, 2, 51, 51,
135
+ 51, 51, 51, 1, 2, 52, 52, 52, 52, 52, 1, 2,
136
+ 53, 53, 53, 53, 53, 1, 2, 54, 54, 54, 54, 54,
137
+ 1, 2, 55, 55, 55, 55, 55, 1, 2, 56, 56, 56,
138
+ 56, 56, 1, 2, 57, 57, 57, 57, 57, 1, 2, 58,
139
+ 58, 58, 58, 58, 1, 2, 59, 59, 59, 59, 59, 1,
140
+ 2, 60, 60, 60, 60, 60, 1, 2, 61, 61, 61, 61,
141
+ 61, 1, 2, 62, 62, 62, 62, 62, 1, 2, 63, 63,
142
+ 63, 63, 63, 1, 2, 64, 64, 64, 64, 64, 1, 2,
143
+ 65, 65, 65, 65, 65, 1, 2, 66, 66, 66, 66, 66,
144
+ 1, 2, 1, 1, 0
158
145
  };
159
146
  }
160
147
 
@@ -164,13 +151,12 @@ private static final byte _puma_parser_indicies[] = init__puma_parser_indicies_0
164
151
  private static byte[] init__puma_parser_trans_targs_0()
165
152
  {
166
153
  return new byte [] {
167
- 2, 0, 3, 38, 4, 24, 28, 25, 5, 20, 6, 7,
168
- 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 57, 17,
169
- 18, 19, 14, 18, 19, 14, 5, 21, 22, 5, 21, 22,
170
- 23, 24, 25, 26, 27, 5, 28, 20, 29, 31, 34, 30,
171
- 31, 32, 34, 33, 5, 35, 20, 36, 5, 35, 20, 36,
172
- 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
173
- 50, 51, 52, 53, 54, 55, 56
154
+ 2, 0, 3, 28, 4, 22, 24, 23, 5, 20, 6, 7,
155
+ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 47, 17,
156
+ 18, 19, 14, 18, 19, 14, 5, 21, 5, 21, 22, 23,
157
+ 5, 24, 20, 25, 26, 25, 26, 5, 27, 20, 5, 27,
158
+ 20, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
159
+ 40, 41, 42, 43, 44, 45, 46
174
160
  };
175
161
  }
176
162
 
@@ -182,10 +168,9 @@ private static byte[] init__puma_parser_trans_actions_0()
182
168
  return new byte [] {
183
169
  1, 0, 11, 0, 1, 1, 1, 1, 13, 13, 1, 0,
184
170
  0, 0, 0, 0, 0, 0, 19, 0, 0, 28, 23, 3,
185
- 5, 7, 31, 7, 0, 9, 25, 1, 1, 15, 0, 0,
186
- 0, 0, 0, 0, 0, 37, 0, 37, 0, 21, 21, 0,
187
- 0, 0, 0, 0, 40, 17, 40, 17, 34, 0, 34, 0,
188
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
171
+ 5, 7, 31, 7, 0, 9, 25, 1, 15, 0, 0, 0,
172
+ 37, 0, 37, 21, 21, 0, 0, 40, 17, 40, 34, 0,
173
+ 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
189
174
  0, 0, 0, 0, 0, 0, 0
190
175
  };
191
176
  }
@@ -194,12 +179,9 @@ private static final byte _puma_parser_trans_actions[] = init__puma_parser_trans
194
179
 
195
180
 
196
181
  static final int puma_parser_start = 1;
197
- static final int puma_parser_first_final = 57;
182
+ static final int puma_parser_first_final = 47;
198
183
  static final int puma_parser_error = 0;
199
184
 
200
- static final int puma_parser_en_main = 1;
201
-
202
-
203
185
  // line 69 "ext/puma_http11/http11_parser.java.rl"
204
186
 
205
187
  public static interface ElementCB {
@@ -235,8 +217,8 @@ static final int puma_parser_en_main = 1;
235
217
  public void init() {
236
218
  cs = 0;
237
219
 
238
-
239
- // line 240 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
220
+
221
+ // line 225 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
240
222
  {
241
223
  cs = puma_parser_start;
242
224
  }
@@ -267,8 +249,8 @@ static final int puma_parser_en_main = 1;
267
249
  byte[] data = buffer.bytes();
268
250
  parser.buffer = buffer;
269
251
 
270
-
271
- // line 272 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
252
+
253
+ // line 257 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
272
254
  {
273
255
  int _klen;
274
256
  int _trans = 0;
@@ -362,7 +344,7 @@ case 1:
362
344
  break;
363
345
  case 3:
364
346
  // line 17 "ext/puma_http11/http11_parser.java.rl"
365
- {
347
+ {
366
348
  parser.field_len = p-parser.field_start;
367
349
  }
368
350
  break;
@@ -372,7 +354,7 @@ case 1:
372
354
  break;
373
355
  case 5:
374
356
  // line 22 "ext/puma_http11/http11_parser.java.rl"
375
- {
357
+ {
376
358
  if(parser.http_field != null) {
377
359
  parser.http_field.call(parser.data, parser.field_start, parser.field_len, parser.mark, p-parser.mark);
378
360
  }
@@ -380,21 +362,21 @@ case 1:
380
362
  break;
381
363
  case 6:
382
364
  // line 27 "ext/puma_http11/http11_parser.java.rl"
383
- {
384
- if(parser.request_method != null)
365
+ {
366
+ if(parser.request_method != null)
385
367
  parser.request_method.call(parser.data, parser.mark, p-parser.mark);
386
368
  }
387
369
  break;
388
370
  case 7:
389
371
  // line 31 "ext/puma_http11/http11_parser.java.rl"
390
- {
372
+ {
391
373
  if(parser.request_uri != null)
392
374
  parser.request_uri.call(parser.data, parser.mark, p-parser.mark);
393
375
  }
394
376
  break;
395
377
  case 8:
396
378
  // line 35 "ext/puma_http11/http11_parser.java.rl"
397
- {
379
+ {
398
380
  if(parser.fragment != null)
399
381
  parser.fragment.call(parser.data, parser.mark, p-parser.mark);
400
382
  }
@@ -405,14 +387,14 @@ case 1:
405
387
  break;
406
388
  case 10:
407
389
  // line 41 "ext/puma_http11/http11_parser.java.rl"
408
- {
390
+ {
409
391
  if(parser.query_string != null)
410
392
  parser.query_string.call(parser.data, parser.query_start, p-parser.query_start);
411
393
  }
412
394
  break;
413
395
  case 11:
414
396
  // line 46 "ext/puma_http11/http11_parser.java.rl"
415
- {
397
+ {
416
398
  if(parser.http_version != null)
417
399
  parser.http_version.call(parser.data, parser.mark, p-parser.mark);
418
400
  }
@@ -426,14 +408,14 @@ case 1:
426
408
  break;
427
409
  case 13:
428
410
  // line 56 "ext/puma_http11/http11_parser.java.rl"
429
- {
430
- parser.body_start = p + 1;
411
+ {
412
+ parser.body_start = p + 1;
431
413
  if(parser.header_done != null)
432
414
  parser.header_done.call(parser.data, p + 1, pe - p - 1);
433
415
  { p += 1; _goto_targ = 5; if (true) continue _goto;}
434
416
  }
435
417
  break;
436
- // line 437 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
418
+ // line 422 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
437
419
  }
438
420
  }
439
421
  }
@@ -457,7 +439,7 @@ case 5:
457
439
 
458
440
  parser.cs = cs;
459
441
  parser.nread += (p - off);
460
-
442
+
461
443
  assert p <= pe : "buffer overflow after parsing execute";
462
444
  assert parser.nread <= len : "nread longer than length";
463
445
  assert parser.body_start <= len : "body starts after buffer end";