puma 2.16.0 → 3.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. checksums.yaml +5 -5
  2. data/{History.txt → History.md} +489 -70
  3. data/README.md +143 -174
  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/nginx.md +2 -2
  10. data/docs/plugins.md +28 -0
  11. data/docs/restart.md +39 -0
  12. data/docs/signals.md +56 -3
  13. data/docs/systemd.md +272 -0
  14. data/ext/puma_http11/extconf.rb +2 -0
  15. data/ext/puma_http11/http11_parser.c +291 -447
  16. data/ext/puma_http11/http11_parser.h +1 -0
  17. data/ext/puma_http11/http11_parser.java.rl +5 -5
  18. data/ext/puma_http11/http11_parser.rl +10 -9
  19. data/ext/puma_http11/http11_parser_common.rl +1 -1
  20. data/ext/puma_http11/io_buffer.c +8 -8
  21. data/ext/puma_http11/mini_ssl.c +64 -6
  22. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +113 -131
  23. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +9 -2
  24. data/ext/puma_http11/puma_http11.c +1 -0
  25. data/lib/puma/app/status.rb +9 -1
  26. data/lib/puma/binder.rb +90 -38
  27. data/lib/puma/cli.rb +134 -491
  28. data/lib/puma/client.rb +142 -4
  29. data/lib/puma/cluster.rb +132 -76
  30. data/lib/puma/commonlogger.rb +19 -20
  31. data/lib/puma/compat.rb +3 -7
  32. data/lib/puma/configuration.rb +206 -67
  33. data/lib/puma/const.rb +21 -31
  34. data/lib/puma/control_cli.rb +92 -103
  35. data/lib/puma/convenient.rb +23 -0
  36. data/lib/puma/daemon_ext.rb +6 -0
  37. data/lib/puma/detect.rb +10 -1
  38. data/lib/puma/dsl.rb +203 -45
  39. data/lib/puma/events.rb +22 -13
  40. data/lib/puma/io_buffer.rb +1 -1
  41. data/lib/puma/jruby_restart.rb +1 -2
  42. data/lib/puma/launcher.rb +431 -0
  43. data/lib/puma/minissl.rb +83 -4
  44. data/lib/puma/null_io.rb +19 -11
  45. data/lib/puma/plugin/tmp_restart.rb +34 -0
  46. data/lib/puma/plugin.rb +115 -0
  47. data/lib/puma/rack/backports/uri/common_193.rb +17 -13
  48. data/lib/puma/rack/builder.rb +3 -0
  49. data/lib/puma/rack/urlmap.rb +9 -8
  50. data/lib/puma/reactor.rb +18 -0
  51. data/lib/puma/runner.rb +43 -15
  52. data/lib/puma/server.rb +141 -35
  53. data/lib/puma/single.rb +16 -6
  54. data/lib/puma/state_file.rb +29 -0
  55. data/lib/puma/tcp_logger.rb +8 -1
  56. data/lib/puma/thread_pool.rb +60 -10
  57. data/lib/puma/util.rb +1 -5
  58. data/lib/puma.rb +13 -4
  59. data/lib/rack/handler/puma.rb +76 -29
  60. data/tools/jungle/README.md +12 -2
  61. data/tools/jungle/init.d/README.md +9 -2
  62. data/tools/jungle/init.d/puma +86 -59
  63. data/tools/jungle/init.d/run-puma +16 -1
  64. data/tools/jungle/rc.d/README.md +74 -0
  65. data/tools/jungle/rc.d/puma +61 -0
  66. data/tools/jungle/rc.d/puma.conf +10 -0
  67. data/tools/jungle/upstart/puma.conf +1 -1
  68. data/tools/trickletest.rb +1 -1
  69. metadata +28 -95
  70. data/COPYING +0 -55
  71. data/Gemfile +0 -13
  72. data/Manifest.txt +0 -74
  73. data/Rakefile +0 -158
  74. data/docs/config.md +0 -0
  75. data/lib/puma/capistrano.rb +0 -94
  76. data/lib/puma/rack/backports/uri/common_18.rb +0 -56
  77. data/lib/puma/rack/backports/uri/common_192.rb +0 -52
  78. data/puma.gemspec +0 -52
@@ -1,8 +1,9 @@
1
1
 
2
- #line 1 "ext/http11/http11_parser.rl"
2
+ #line 1 "ext/puma_http11/http11_parser.rl"
3
3
  /**
4
4
  * Copyright (c) 2005 Zed A. Shaw
5
5
  * You can redistribute it and/or modify it under the same terms as Ruby.
6
+ * License 3-clause BSD
6
7
  */
7
8
  #include "http11_parser.h"
8
9
  #include <stdio.h>
@@ -30,30 +31,30 @@ static void snake_upcase_char(char *c)
30
31
  /** Machine **/
31
32
 
32
33
 
33
- #line 78 "ext/http11/http11_parser.rl"
34
+ #line 79 "ext/puma_http11/http11_parser.rl"
34
35
 
35
36
 
36
37
  /** Data **/
37
38
 
38
- #line 39 "ext/http11/http11_parser.c"
39
+ #line 40 "ext/puma_http11/http11_parser.c"
39
40
  static const int puma_parser_start = 1;
40
- static const int puma_parser_first_final = 57;
41
+ static const int puma_parser_first_final = 47;
41
42
  static const int puma_parser_error = 0;
42
43
 
43
44
  static const int puma_parser_en_main = 1;
44
45
 
45
46
 
46
- #line 82 "ext/http11/http11_parser.rl"
47
+ #line 83 "ext/puma_http11/http11_parser.rl"
47
48
 
48
49
  int puma_parser_init(puma_parser *parser) {
49
50
  int cs = 0;
50
51
 
51
- #line 52 "ext/http11/http11_parser.c"
52
+ #line 53 "ext/puma_http11/http11_parser.c"
52
53
  {
53
54
  cs = puma_parser_start;
54
55
  }
55
56
 
56
- #line 86 "ext/http11/http11_parser.rl"
57
+ #line 87 "ext/puma_http11/http11_parser.rl"
57
58
  parser->cs = cs;
58
59
  parser->body_start = 0;
59
60
  parser->content_len = 0;
@@ -79,10 +80,10 @@ size_t puma_parser_execute(puma_parser *parser, const char *buffer, size_t len,
79
80
  pe = buffer+len;
80
81
 
81
82
  /* assert(*pe == '\0' && "pointer does not end on NUL"); */
82
- assert(pe - p == len - off && "pointers aren't same distance");
83
+ assert((size_t) (pe - p) == len - off && "pointers aren't same distance");
83
84
 
84
85
 
85
- #line 86 "ext/http11/http11_parser.c"
86
+ #line 87 "ext/puma_http11/http11_parser.c"
86
87
  {
87
88
  if ( p == pe )
88
89
  goto _test_eof;
@@ -106,31 +107,31 @@ st0:
106
107
  cs = 0;
107
108
  goto _out;
108
109
  tr0:
109
- #line 34 "ext/http11/http11_parser.rl"
110
+ #line 35 "ext/puma_http11/http11_parser.rl"
110
111
  { MARK(mark, p); }
111
112
  goto st2;
112
113
  st2:
113
114
  if ( ++p == pe )
114
115
  goto _test_eof2;
115
116
  case 2:
116
- #line 117 "ext/http11/http11_parser.c"
117
+ #line 118 "ext/puma_http11/http11_parser.c"
117
118
  switch( (*p) ) {
118
119
  case 32: goto tr2;
119
- case 36: goto st38;
120
- case 95: goto st38;
120
+ case 36: goto st28;
121
+ case 95: goto st28;
121
122
  }
122
123
  if ( (*p) < 48 ) {
123
124
  if ( 45 <= (*p) && (*p) <= 46 )
124
- goto st38;
125
+ goto st28;
125
126
  } else if ( (*p) > 57 ) {
126
127
  if ( 65 <= (*p) && (*p) <= 90 )
127
- goto st38;
128
+ goto st28;
128
129
  } else
129
- goto st38;
130
+ goto st28;
130
131
  goto st0;
131
132
  tr2:
132
- #line 47 "ext/http11/http11_parser.rl"
133
- {
133
+ #line 48 "ext/puma_http11/http11_parser.rl"
134
+ {
134
135
  parser->request_method(parser, PTR_TO(mark), LEN(mark, p));
135
136
  }
136
137
  goto st3;
@@ -138,7 +139,7 @@ st3:
138
139
  if ( ++p == pe )
139
140
  goto _test_eof3;
140
141
  case 3:
141
- #line 142 "ext/http11/http11_parser.c"
142
+ #line 143 "ext/puma_http11/http11_parser.c"
142
143
  switch( (*p) ) {
143
144
  case 42: goto tr4;
144
145
  case 43: goto tr5;
@@ -155,68 +156,68 @@ case 3:
155
156
  goto tr5;
156
157
  goto st0;
157
158
  tr4:
158
- #line 34 "ext/http11/http11_parser.rl"
159
+ #line 35 "ext/puma_http11/http11_parser.rl"
159
160
  { MARK(mark, p); }
160
161
  goto st4;
161
162
  st4:
162
163
  if ( ++p == pe )
163
164
  goto _test_eof4;
164
165
  case 4:
165
- #line 166 "ext/http11/http11_parser.c"
166
+ #line 167 "ext/puma_http11/http11_parser.c"
166
167
  switch( (*p) ) {
167
168
  case 32: goto tr8;
168
169
  case 35: goto tr9;
169
170
  }
170
171
  goto st0;
171
172
  tr8:
172
- #line 50 "ext/http11/http11_parser.rl"
173
- {
173
+ #line 51 "ext/puma_http11/http11_parser.rl"
174
+ {
174
175
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
175
176
  }
176
177
  goto st5;
177
178
  tr31:
178
- #line 34 "ext/http11/http11_parser.rl"
179
+ #line 35 "ext/puma_http11/http11_parser.rl"
179
180
  { MARK(mark, p); }
180
- #line 53 "ext/http11/http11_parser.rl"
181
+ #line 54 "ext/puma_http11/http11_parser.rl"
181
182
  {
182
183
  parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
183
184
  }
184
185
  goto st5;
185
- tr34:
186
- #line 53 "ext/http11/http11_parser.rl"
186
+ tr33:
187
+ #line 54 "ext/puma_http11/http11_parser.rl"
187
188
  {
188
189
  parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
189
190
  }
190
191
  goto st5;
191
- tr42:
192
- #line 66 "ext/http11/http11_parser.rl"
192
+ tr37:
193
+ #line 67 "ext/puma_http11/http11_parser.rl"
193
194
  {
194
195
  parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
195
196
  }
196
- #line 50 "ext/http11/http11_parser.rl"
197
- {
197
+ #line 51 "ext/puma_http11/http11_parser.rl"
198
+ {
198
199
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
199
200
  }
200
201
  goto st5;
201
- tr53:
202
- #line 57 "ext/http11/http11_parser.rl"
202
+ tr44:
203
+ #line 58 "ext/puma_http11/http11_parser.rl"
203
204
  { MARK(query_start, p); }
204
- #line 58 "ext/http11/http11_parser.rl"
205
- {
205
+ #line 59 "ext/puma_http11/http11_parser.rl"
206
+ {
206
207
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
207
208
  }
208
- #line 50 "ext/http11/http11_parser.rl"
209
- {
209
+ #line 51 "ext/puma_http11/http11_parser.rl"
210
+ {
210
211
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
211
212
  }
212
213
  goto st5;
213
- tr57:
214
- #line 58 "ext/http11/http11_parser.rl"
215
- {
214
+ tr47:
215
+ #line 59 "ext/puma_http11/http11_parser.rl"
216
+ {
216
217
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
217
218
  }
218
- #line 50 "ext/http11/http11_parser.rl"
219
- {
219
+ #line 51 "ext/puma_http11/http11_parser.rl"
220
+ {
220
221
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
221
222
  }
222
223
  goto st5;
@@ -224,19 +225,19 @@ st5:
224
225
  if ( ++p == pe )
225
226
  goto _test_eof5;
226
227
  case 5:
227
- #line 228 "ext/http11/http11_parser.c"
228
+ #line 229 "ext/puma_http11/http11_parser.c"
228
229
  if ( (*p) == 72 )
229
230
  goto tr10;
230
231
  goto st0;
231
232
  tr10:
232
- #line 34 "ext/http11/http11_parser.rl"
233
+ #line 35 "ext/puma_http11/http11_parser.rl"
233
234
  { MARK(mark, p); }
234
235
  goto st6;
235
236
  st6:
236
237
  if ( ++p == pe )
237
238
  goto _test_eof6;
238
239
  case 6:
239
- #line 240 "ext/http11/http11_parser.c"
240
+ #line 241 "ext/puma_http11/http11_parser.c"
240
241
  if ( (*p) == 84 )
241
242
  goto st7;
242
243
  goto st0;
@@ -294,21 +295,21 @@ case 13:
294
295
  goto st13;
295
296
  goto st0;
296
297
  tr18:
297
- #line 62 "ext/http11/http11_parser.rl"
298
- {
298
+ #line 63 "ext/puma_http11/http11_parser.rl"
299
+ {
299
300
  parser->http_version(parser, PTR_TO(mark), LEN(mark, p));
300
301
  }
301
302
  goto st14;
302
303
  tr26:
303
- #line 43 "ext/http11/http11_parser.rl"
304
+ #line 44 "ext/puma_http11/http11_parser.rl"
304
305
  { MARK(mark, p); }
305
- #line 44 "ext/http11/http11_parser.rl"
306
+ #line 45 "ext/puma_http11/http11_parser.rl"
306
307
  {
307
308
  parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
308
309
  }
309
310
  goto st14;
310
311
  tr29:
311
- #line 44 "ext/http11/http11_parser.rl"
312
+ #line 45 "ext/puma_http11/http11_parser.rl"
312
313
  {
313
314
  parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
314
315
  }
@@ -317,7 +318,7 @@ st14:
317
318
  if ( ++p == pe )
318
319
  goto _test_eof14;
319
320
  case 14:
320
- #line 321 "ext/http11/http11_parser.c"
321
+ #line 322 "ext/puma_http11/http11_parser.c"
321
322
  if ( (*p) == 10 )
322
323
  goto st15;
323
324
  goto st0;
@@ -357,34 +358,34 @@ case 16:
357
358
  goto tr22;
358
359
  goto st0;
359
360
  tr22:
360
- #line 70 "ext/http11/http11_parser.rl"
361
- {
362
- parser->body_start = p - buffer + 1;
361
+ #line 71 "ext/puma_http11/http11_parser.rl"
362
+ {
363
+ parser->body_start = p - buffer + 1;
363
364
  parser->header_done(parser, p + 1, pe - p - 1);
364
- {p++; cs = 57; goto _out;}
365
+ {p++; cs = 47; goto _out;}
365
366
  }
366
- goto st57;
367
- st57:
367
+ goto st47;
368
+ st47:
368
369
  if ( ++p == pe )
369
- goto _test_eof57;
370
- case 57:
371
- #line 372 "ext/http11/http11_parser.c"
370
+ goto _test_eof47;
371
+ case 47:
372
+ #line 373 "ext/puma_http11/http11_parser.c"
372
373
  goto st0;
373
374
  tr21:
374
- #line 37 "ext/http11/http11_parser.rl"
375
+ #line 38 "ext/puma_http11/http11_parser.rl"
375
376
  { MARK(field_start, p); }
376
- #line 38 "ext/http11/http11_parser.rl"
377
+ #line 39 "ext/puma_http11/http11_parser.rl"
377
378
  { snake_upcase_char((char *)p); }
378
379
  goto st17;
379
380
  tr23:
380
- #line 38 "ext/http11/http11_parser.rl"
381
+ #line 39 "ext/puma_http11/http11_parser.rl"
381
382
  { snake_upcase_char((char *)p); }
382
383
  goto st17;
383
384
  st17:
384
385
  if ( ++p == pe )
385
386
  goto _test_eof17;
386
387
  case 17:
387
- #line 388 "ext/http11/http11_parser.c"
388
+ #line 389 "ext/puma_http11/http11_parser.c"
388
389
  switch( (*p) ) {
389
390
  case 33: goto tr23;
390
391
  case 58: goto tr24;
@@ -410,72 +411,72 @@ case 17:
410
411
  goto tr23;
411
412
  goto st0;
412
413
  tr24:
413
- #line 39 "ext/http11/http11_parser.rl"
414
- {
414
+ #line 40 "ext/puma_http11/http11_parser.rl"
415
+ {
415
416
  parser->field_len = LEN(field_start, p);
416
417
  }
417
418
  goto st18;
418
419
  tr27:
419
- #line 43 "ext/http11/http11_parser.rl"
420
+ #line 44 "ext/puma_http11/http11_parser.rl"
420
421
  { MARK(mark, p); }
421
422
  goto st18;
422
423
  st18:
423
424
  if ( ++p == pe )
424
425
  goto _test_eof18;
425
426
  case 18:
426
- #line 427 "ext/http11/http11_parser.c"
427
+ #line 428 "ext/puma_http11/http11_parser.c"
427
428
  switch( (*p) ) {
428
429
  case 13: goto tr26;
429
430
  case 32: goto tr27;
430
431
  }
431
432
  goto tr25;
432
433
  tr25:
433
- #line 43 "ext/http11/http11_parser.rl"
434
+ #line 44 "ext/puma_http11/http11_parser.rl"
434
435
  { MARK(mark, p); }
435
436
  goto st19;
436
437
  st19:
437
438
  if ( ++p == pe )
438
439
  goto _test_eof19;
439
440
  case 19:
440
- #line 441 "ext/http11/http11_parser.c"
441
+ #line 442 "ext/puma_http11/http11_parser.c"
441
442
  if ( (*p) == 13 )
442
443
  goto tr29;
443
444
  goto st19;
444
445
  tr9:
445
- #line 50 "ext/http11/http11_parser.rl"
446
- {
446
+ #line 51 "ext/puma_http11/http11_parser.rl"
447
+ {
447
448
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
448
449
  }
449
450
  goto st20;
450
- tr43:
451
- #line 66 "ext/http11/http11_parser.rl"
451
+ tr38:
452
+ #line 67 "ext/puma_http11/http11_parser.rl"
452
453
  {
453
454
  parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
454
455
  }
455
- #line 50 "ext/http11/http11_parser.rl"
456
- {
456
+ #line 51 "ext/puma_http11/http11_parser.rl"
457
+ {
457
458
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
458
459
  }
459
460
  goto st20;
460
- tr54:
461
- #line 57 "ext/http11/http11_parser.rl"
461
+ tr45:
462
+ #line 58 "ext/puma_http11/http11_parser.rl"
462
463
  { MARK(query_start, p); }
463
- #line 58 "ext/http11/http11_parser.rl"
464
- {
464
+ #line 59 "ext/puma_http11/http11_parser.rl"
465
+ {
465
466
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
466
467
  }
467
- #line 50 "ext/http11/http11_parser.rl"
468
- {
468
+ #line 51 "ext/puma_http11/http11_parser.rl"
469
+ {
469
470
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
470
471
  }
471
472
  goto st20;
472
- tr58:
473
- #line 58 "ext/http11/http11_parser.rl"
474
- {
473
+ tr48:
474
+ #line 59 "ext/puma_http11/http11_parser.rl"
475
+ {
475
476
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
476
477
  }
477
- #line 50 "ext/http11/http11_parser.rl"
478
- {
478
+ #line 51 "ext/puma_http11/http11_parser.rl"
479
+ {
479
480
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
480
481
  }
481
482
  goto st20;
@@ -483,10 +484,9 @@ st20:
483
484
  if ( ++p == pe )
484
485
  goto _test_eof20;
485
486
  case 20:
486
- #line 487 "ext/http11/http11_parser.c"
487
+ #line 488 "ext/puma_http11/http11_parser.c"
487
488
  switch( (*p) ) {
488
489
  case 32: goto tr31;
489
- case 37: goto tr32;
490
490
  case 60: goto st0;
491
491
  case 62: goto st0;
492
492
  case 127: goto st0;
@@ -498,17 +498,16 @@ case 20:
498
498
  goto st0;
499
499
  goto tr30;
500
500
  tr30:
501
- #line 34 "ext/http11/http11_parser.rl"
501
+ #line 35 "ext/puma_http11/http11_parser.rl"
502
502
  { MARK(mark, p); }
503
503
  goto st21;
504
504
  st21:
505
505
  if ( ++p == pe )
506
506
  goto _test_eof21;
507
507
  case 21:
508
- #line 509 "ext/http11/http11_parser.c"
508
+ #line 509 "ext/puma_http11/http11_parser.c"
509
509
  switch( (*p) ) {
510
- case 32: goto tr34;
511
- case 37: goto st22;
510
+ case 32: goto tr33;
512
511
  case 60: goto st0;
513
512
  case 62: goto st0;
514
513
  case 127: goto st0;
@@ -519,141 +518,170 @@ case 21:
519
518
  } else if ( (*p) >= 0 )
520
519
  goto st0;
521
520
  goto st21;
522
- tr32:
523
- #line 34 "ext/http11/http11_parser.rl"
521
+ tr5:
522
+ #line 35 "ext/puma_http11/http11_parser.rl"
524
523
  { MARK(mark, p); }
525
524
  goto st22;
526
525
  st22:
527
526
  if ( ++p == pe )
528
527
  goto _test_eof22;
529
528
  case 22:
530
- #line 531 "ext/http11/http11_parser.c"
531
- if ( (*p) < 65 ) {
532
- if ( 48 <= (*p) && (*p) <= 57 )
533
- goto st23;
534
- } else if ( (*p) > 70 ) {
535
- if ( 97 <= (*p) && (*p) <= 102 )
536
- goto st23;
529
+ #line 530 "ext/puma_http11/http11_parser.c"
530
+ switch( (*p) ) {
531
+ case 43: goto st22;
532
+ case 58: goto st23;
533
+ }
534
+ if ( (*p) < 48 ) {
535
+ if ( 45 <= (*p) && (*p) <= 46 )
536
+ goto st22;
537
+ } else if ( (*p) > 57 ) {
538
+ if ( (*p) > 90 ) {
539
+ if ( 97 <= (*p) && (*p) <= 122 )
540
+ goto st22;
541
+ } else if ( (*p) >= 65 )
542
+ goto st22;
537
543
  } else
538
- goto st23;
544
+ goto st22;
539
545
  goto st0;
546
+ tr7:
547
+ #line 35 "ext/puma_http11/http11_parser.rl"
548
+ { MARK(mark, p); }
549
+ goto st23;
540
550
  st23:
541
551
  if ( ++p == pe )
542
552
  goto _test_eof23;
543
553
  case 23:
544
- if ( (*p) < 65 ) {
545
- if ( 48 <= (*p) && (*p) <= 57 )
546
- goto st21;
547
- } else if ( (*p) > 70 ) {
548
- if ( 97 <= (*p) && (*p) <= 102 )
549
- goto st21;
550
- } else
551
- goto st21;
552
- goto st0;
553
- tr5:
554
- #line 34 "ext/http11/http11_parser.rl"
554
+ #line 555 "ext/puma_http11/http11_parser.c"
555
+ switch( (*p) ) {
556
+ case 32: goto tr8;
557
+ case 34: goto st0;
558
+ case 35: goto tr9;
559
+ case 60: goto st0;
560
+ case 62: goto st0;
561
+ case 127: goto st0;
562
+ }
563
+ if ( 0 <= (*p) && (*p) <= 31 )
564
+ goto st0;
565
+ goto st23;
566
+ tr6:
567
+ #line 35 "ext/puma_http11/http11_parser.rl"
555
568
  { MARK(mark, p); }
556
569
  goto st24;
557
570
  st24:
558
571
  if ( ++p == pe )
559
572
  goto _test_eof24;
560
573
  case 24:
561
- #line 562 "ext/http11/http11_parser.c"
574
+ #line 575 "ext/puma_http11/http11_parser.c"
562
575
  switch( (*p) ) {
563
- case 43: goto st24;
564
- case 58: goto st25;
576
+ case 32: goto tr37;
577
+ case 34: goto st0;
578
+ case 35: goto tr38;
579
+ case 59: goto tr39;
580
+ case 60: goto st0;
581
+ case 62: goto st0;
582
+ case 63: goto tr40;
583
+ case 127: goto st0;
565
584
  }
566
- if ( (*p) < 48 ) {
567
- if ( 45 <= (*p) && (*p) <= 46 )
568
- goto st24;
569
- } else if ( (*p) > 57 ) {
570
- if ( (*p) > 90 ) {
571
- if ( 97 <= (*p) && (*p) <= 122 )
572
- goto st24;
573
- } else if ( (*p) >= 65 )
574
- goto st24;
575
- } else
576
- goto st24;
577
- goto st0;
578
- tr7:
579
- #line 34 "ext/http11/http11_parser.rl"
580
- { MARK(mark, p); }
585
+ if ( 0 <= (*p) && (*p) <= 31 )
586
+ goto st0;
587
+ goto st24;
588
+ tr39:
589
+ #line 67 "ext/puma_http11/http11_parser.rl"
590
+ {
591
+ parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
592
+ }
581
593
  goto st25;
582
594
  st25:
583
595
  if ( ++p == pe )
584
596
  goto _test_eof25;
585
597
  case 25:
586
- #line 587 "ext/http11/http11_parser.c"
598
+ #line 599 "ext/puma_http11/http11_parser.c"
587
599
  switch( (*p) ) {
588
600
  case 32: goto tr8;
589
601
  case 34: goto st0;
590
602
  case 35: goto tr9;
591
- case 37: goto st26;
592
603
  case 60: goto st0;
593
604
  case 62: goto st0;
605
+ case 63: goto st26;
594
606
  case 127: goto st0;
595
607
  }
596
608
  if ( 0 <= (*p) && (*p) <= 31 )
597
609
  goto st0;
598
610
  goto st25;
611
+ tr40:
612
+ #line 67 "ext/puma_http11/http11_parser.rl"
613
+ {
614
+ parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
615
+ }
616
+ goto st26;
599
617
  st26:
600
618
  if ( ++p == pe )
601
619
  goto _test_eof26;
602
620
  case 26:
603
- if ( (*p) < 65 ) {
604
- if ( 48 <= (*p) && (*p) <= 57 )
605
- goto st27;
606
- } else if ( (*p) > 70 ) {
607
- if ( 97 <= (*p) && (*p) <= 102 )
608
- goto st27;
609
- } else
610
- goto st27;
611
- goto st0;
621
+ #line 622 "ext/puma_http11/http11_parser.c"
622
+ switch( (*p) ) {
623
+ case 32: goto tr44;
624
+ case 34: goto st0;
625
+ case 35: goto tr45;
626
+ case 60: goto st0;
627
+ case 62: goto st0;
628
+ case 127: goto st0;
629
+ }
630
+ if ( 0 <= (*p) && (*p) <= 31 )
631
+ goto st0;
632
+ goto tr43;
633
+ tr43:
634
+ #line 58 "ext/puma_http11/http11_parser.rl"
635
+ { MARK(query_start, p); }
636
+ goto st27;
612
637
  st27:
613
638
  if ( ++p == pe )
614
639
  goto _test_eof27;
615
640
  case 27:
616
- if ( (*p) < 65 ) {
617
- if ( 48 <= (*p) && (*p) <= 57 )
618
- goto st25;
619
- } else if ( (*p) > 70 ) {
620
- if ( 97 <= (*p) && (*p) <= 102 )
621
- goto st25;
622
- } else
623
- goto st25;
624
- goto st0;
625
- tr6:
626
- #line 34 "ext/http11/http11_parser.rl"
627
- { MARK(mark, p); }
628
- goto st28;
629
- st28:
630
- if ( ++p == pe )
631
- goto _test_eof28;
632
- case 28:
633
- #line 634 "ext/http11/http11_parser.c"
641
+ #line 642 "ext/puma_http11/http11_parser.c"
634
642
  switch( (*p) ) {
635
- case 32: goto tr42;
643
+ case 32: goto tr47;
636
644
  case 34: goto st0;
637
- case 35: goto tr43;
638
- case 37: goto st29;
639
- case 59: goto tr45;
645
+ case 35: goto tr48;
640
646
  case 60: goto st0;
641
647
  case 62: goto st0;
642
- case 63: goto tr46;
643
648
  case 127: goto st0;
644
649
  }
645
650
  if ( 0 <= (*p) && (*p) <= 31 )
646
651
  goto st0;
647
- goto st28;
652
+ goto st27;
653
+ st28:
654
+ if ( ++p == pe )
655
+ goto _test_eof28;
656
+ case 28:
657
+ switch( (*p) ) {
658
+ case 32: goto tr2;
659
+ case 36: goto st29;
660
+ case 95: goto st29;
661
+ }
662
+ if ( (*p) < 48 ) {
663
+ if ( 45 <= (*p) && (*p) <= 46 )
664
+ goto st29;
665
+ } else if ( (*p) > 57 ) {
666
+ if ( 65 <= (*p) && (*p) <= 90 )
667
+ goto st29;
668
+ } else
669
+ goto st29;
670
+ goto st0;
648
671
  st29:
649
672
  if ( ++p == pe )
650
673
  goto _test_eof29;
651
674
  case 29:
652
- if ( (*p) < 65 ) {
653
- if ( 48 <= (*p) && (*p) <= 57 )
675
+ switch( (*p) ) {
676
+ case 32: goto tr2;
677
+ case 36: goto st30;
678
+ case 95: goto st30;
679
+ }
680
+ if ( (*p) < 48 ) {
681
+ if ( 45 <= (*p) && (*p) <= 46 )
654
682
  goto st30;
655
- } else if ( (*p) > 70 ) {
656
- if ( 97 <= (*p) && (*p) <= 102 )
683
+ } else if ( (*p) > 57 ) {
684
+ if ( 65 <= (*p) && (*p) <= 90 )
657
685
  goto st30;
658
686
  } else
659
687
  goto st30;
@@ -662,48 +690,52 @@ st30:
662
690
  if ( ++p == pe )
663
691
  goto _test_eof30;
664
692
  case 30:
665
- if ( (*p) < 65 ) {
666
- if ( 48 <= (*p) && (*p) <= 57 )
667
- goto st28;
668
- } else if ( (*p) > 70 ) {
669
- if ( 97 <= (*p) && (*p) <= 102 )
670
- goto st28;
693
+ switch( (*p) ) {
694
+ case 32: goto tr2;
695
+ case 36: goto st31;
696
+ case 95: goto st31;
697
+ }
698
+ if ( (*p) < 48 ) {
699
+ if ( 45 <= (*p) && (*p) <= 46 )
700
+ goto st31;
701
+ } else if ( (*p) > 57 ) {
702
+ if ( 65 <= (*p) && (*p) <= 90 )
703
+ goto st31;
671
704
  } else
672
- goto st28;
705
+ goto st31;
673
706
  goto st0;
674
- tr45:
675
- #line 66 "ext/http11/http11_parser.rl"
676
- {
677
- parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
678
- }
679
- goto st31;
680
707
  st31:
681
708
  if ( ++p == pe )
682
709
  goto _test_eof31;
683
710
  case 31:
684
- #line 685 "ext/http11/http11_parser.c"
685
711
  switch( (*p) ) {
686
- case 32: goto tr8;
687
- case 34: goto st0;
688
- case 35: goto tr9;
689
- case 37: goto st32;
690
- case 60: goto st0;
691
- case 62: goto st0;
692
- case 63: goto st34;
693
- case 127: goto st0;
712
+ case 32: goto tr2;
713
+ case 36: goto st32;
714
+ case 95: goto st32;
694
715
  }
695
- if ( 0 <= (*p) && (*p) <= 31 )
696
- goto st0;
697
- goto st31;
716
+ if ( (*p) < 48 ) {
717
+ if ( 45 <= (*p) && (*p) <= 46 )
718
+ goto st32;
719
+ } else if ( (*p) > 57 ) {
720
+ if ( 65 <= (*p) && (*p) <= 90 )
721
+ goto st32;
722
+ } else
723
+ goto st32;
724
+ goto st0;
698
725
  st32:
699
726
  if ( ++p == pe )
700
727
  goto _test_eof32;
701
728
  case 32:
702
- if ( (*p) < 65 ) {
703
- if ( 48 <= (*p) && (*p) <= 57 )
729
+ switch( (*p) ) {
730
+ case 32: goto tr2;
731
+ case 36: goto st33;
732
+ case 95: goto st33;
733
+ }
734
+ if ( (*p) < 48 ) {
735
+ if ( 45 <= (*p) && (*p) <= 46 )
704
736
  goto st33;
705
- } else if ( (*p) > 70 ) {
706
- if ( 97 <= (*p) && (*p) <= 102 )
737
+ } else if ( (*p) > 57 ) {
738
+ if ( 65 <= (*p) && (*p) <= 90 )
707
739
  goto st33;
708
740
  } else
709
741
  goto st33;
@@ -712,73 +744,70 @@ st33:
712
744
  if ( ++p == pe )
713
745
  goto _test_eof33;
714
746
  case 33:
715
- if ( (*p) < 65 ) {
716
- if ( 48 <= (*p) && (*p) <= 57 )
717
- goto st31;
718
- } else if ( (*p) > 70 ) {
719
- if ( 97 <= (*p) && (*p) <= 102 )
720
- goto st31;
747
+ switch( (*p) ) {
748
+ case 32: goto tr2;
749
+ case 36: goto st34;
750
+ case 95: goto st34;
751
+ }
752
+ if ( (*p) < 48 ) {
753
+ if ( 45 <= (*p) && (*p) <= 46 )
754
+ goto st34;
755
+ } else if ( (*p) > 57 ) {
756
+ if ( 65 <= (*p) && (*p) <= 90 )
757
+ goto st34;
721
758
  } else
722
- goto st31;
759
+ goto st34;
723
760
  goto st0;
724
- tr46:
725
- #line 66 "ext/http11/http11_parser.rl"
726
- {
727
- parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
728
- }
729
- goto st34;
730
761
  st34:
731
762
  if ( ++p == pe )
732
763
  goto _test_eof34;
733
764
  case 34:
734
- #line 735 "ext/http11/http11_parser.c"
735
765
  switch( (*p) ) {
736
- case 32: goto tr53;
737
- case 34: goto st0;
738
- case 35: goto tr54;
739
- case 37: goto tr55;
740
- case 60: goto st0;
741
- case 62: goto st0;
742
- case 127: goto st0;
766
+ case 32: goto tr2;
767
+ case 36: goto st35;
768
+ case 95: goto st35;
743
769
  }
744
- if ( 0 <= (*p) && (*p) <= 31 )
745
- goto st0;
746
- goto tr52;
747
- tr52:
748
- #line 57 "ext/http11/http11_parser.rl"
749
- { MARK(query_start, p); }
750
- goto st35;
770
+ if ( (*p) < 48 ) {
771
+ if ( 45 <= (*p) && (*p) <= 46 )
772
+ goto st35;
773
+ } else if ( (*p) > 57 ) {
774
+ if ( 65 <= (*p) && (*p) <= 90 )
775
+ goto st35;
776
+ } else
777
+ goto st35;
778
+ goto st0;
751
779
  st35:
752
780
  if ( ++p == pe )
753
781
  goto _test_eof35;
754
782
  case 35:
755
- #line 756 "ext/http11/http11_parser.c"
756
783
  switch( (*p) ) {
757
- case 32: goto tr57;
758
- case 34: goto st0;
759
- case 35: goto tr58;
760
- case 37: goto st36;
761
- case 60: goto st0;
762
- case 62: goto st0;
763
- case 127: goto st0;
784
+ case 32: goto tr2;
785
+ case 36: goto st36;
786
+ case 95: goto st36;
764
787
  }
765
- if ( 0 <= (*p) && (*p) <= 31 )
766
- goto st0;
767
- goto st35;
768
- tr55:
769
- #line 57 "ext/http11/http11_parser.rl"
770
- { MARK(query_start, p); }
771
- goto st36;
788
+ if ( (*p) < 48 ) {
789
+ if ( 45 <= (*p) && (*p) <= 46 )
790
+ goto st36;
791
+ } else if ( (*p) > 57 ) {
792
+ if ( 65 <= (*p) && (*p) <= 90 )
793
+ goto st36;
794
+ } else
795
+ goto st36;
796
+ goto st0;
772
797
  st36:
773
798
  if ( ++p == pe )
774
799
  goto _test_eof36;
775
800
  case 36:
776
- #line 777 "ext/http11/http11_parser.c"
777
- if ( (*p) < 65 ) {
778
- if ( 48 <= (*p) && (*p) <= 57 )
801
+ switch( (*p) ) {
802
+ case 32: goto tr2;
803
+ case 36: goto st37;
804
+ case 95: goto st37;
805
+ }
806
+ if ( (*p) < 48 ) {
807
+ if ( 45 <= (*p) && (*p) <= 46 )
779
808
  goto st37;
780
- } else if ( (*p) > 70 ) {
781
- if ( 97 <= (*p) && (*p) <= 102 )
809
+ } else if ( (*p) > 57 ) {
810
+ if ( 65 <= (*p) && (*p) <= 90 )
782
811
  goto st37;
783
812
  } else
784
813
  goto st37;
@@ -787,14 +816,19 @@ st37:
787
816
  if ( ++p == pe )
788
817
  goto _test_eof37;
789
818
  case 37:
790
- if ( (*p) < 65 ) {
791
- if ( 48 <= (*p) && (*p) <= 57 )
792
- goto st35;
793
- } else if ( (*p) > 70 ) {
794
- if ( 97 <= (*p) && (*p) <= 102 )
795
- goto st35;
819
+ switch( (*p) ) {
820
+ case 32: goto tr2;
821
+ case 36: goto st38;
822
+ case 95: goto st38;
823
+ }
824
+ if ( (*p) < 48 ) {
825
+ if ( 45 <= (*p) && (*p) <= 46 )
826
+ goto st38;
827
+ } else if ( (*p) > 57 ) {
828
+ if ( 65 <= (*p) && (*p) <= 90 )
829
+ goto st38;
796
830
  } else
797
- goto st35;
831
+ goto st38;
798
832
  goto st0;
799
833
  st38:
800
834
  if ( ++p == pe )
@@ -944,186 +978,6 @@ st46:
944
978
  if ( ++p == pe )
945
979
  goto _test_eof46;
946
980
  case 46:
947
- switch( (*p) ) {
948
- case 32: goto tr2;
949
- case 36: goto st47;
950
- case 95: goto st47;
951
- }
952
- if ( (*p) < 48 ) {
953
- if ( 45 <= (*p) && (*p) <= 46 )
954
- goto st47;
955
- } else if ( (*p) > 57 ) {
956
- if ( 65 <= (*p) && (*p) <= 90 )
957
- goto st47;
958
- } else
959
- goto st47;
960
- goto st0;
961
- st47:
962
- if ( ++p == pe )
963
- goto _test_eof47;
964
- case 47:
965
- switch( (*p) ) {
966
- case 32: goto tr2;
967
- case 36: goto st48;
968
- case 95: goto st48;
969
- }
970
- if ( (*p) < 48 ) {
971
- if ( 45 <= (*p) && (*p) <= 46 )
972
- goto st48;
973
- } else if ( (*p) > 57 ) {
974
- if ( 65 <= (*p) && (*p) <= 90 )
975
- goto st48;
976
- } else
977
- goto st48;
978
- goto st0;
979
- st48:
980
- if ( ++p == pe )
981
- goto _test_eof48;
982
- case 48:
983
- switch( (*p) ) {
984
- case 32: goto tr2;
985
- case 36: goto st49;
986
- case 95: goto st49;
987
- }
988
- if ( (*p) < 48 ) {
989
- if ( 45 <= (*p) && (*p) <= 46 )
990
- goto st49;
991
- } else if ( (*p) > 57 ) {
992
- if ( 65 <= (*p) && (*p) <= 90 )
993
- goto st49;
994
- } else
995
- goto st49;
996
- goto st0;
997
- st49:
998
- if ( ++p == pe )
999
- goto _test_eof49;
1000
- case 49:
1001
- switch( (*p) ) {
1002
- case 32: goto tr2;
1003
- case 36: goto st50;
1004
- case 95: goto st50;
1005
- }
1006
- if ( (*p) < 48 ) {
1007
- if ( 45 <= (*p) && (*p) <= 46 )
1008
- goto st50;
1009
- } else if ( (*p) > 57 ) {
1010
- if ( 65 <= (*p) && (*p) <= 90 )
1011
- goto st50;
1012
- } else
1013
- goto st50;
1014
- goto st0;
1015
- st50:
1016
- if ( ++p == pe )
1017
- goto _test_eof50;
1018
- case 50:
1019
- switch( (*p) ) {
1020
- case 32: goto tr2;
1021
- case 36: goto st51;
1022
- case 95: goto st51;
1023
- }
1024
- if ( (*p) < 48 ) {
1025
- if ( 45 <= (*p) && (*p) <= 46 )
1026
- goto st51;
1027
- } else if ( (*p) > 57 ) {
1028
- if ( 65 <= (*p) && (*p) <= 90 )
1029
- goto st51;
1030
- } else
1031
- goto st51;
1032
- goto st0;
1033
- st51:
1034
- if ( ++p == pe )
1035
- goto _test_eof51;
1036
- case 51:
1037
- switch( (*p) ) {
1038
- case 32: goto tr2;
1039
- case 36: goto st52;
1040
- case 95: goto st52;
1041
- }
1042
- if ( (*p) < 48 ) {
1043
- if ( 45 <= (*p) && (*p) <= 46 )
1044
- goto st52;
1045
- } else if ( (*p) > 57 ) {
1046
- if ( 65 <= (*p) && (*p) <= 90 )
1047
- goto st52;
1048
- } else
1049
- goto st52;
1050
- goto st0;
1051
- st52:
1052
- if ( ++p == pe )
1053
- goto _test_eof52;
1054
- case 52:
1055
- switch( (*p) ) {
1056
- case 32: goto tr2;
1057
- case 36: goto st53;
1058
- case 95: goto st53;
1059
- }
1060
- if ( (*p) < 48 ) {
1061
- if ( 45 <= (*p) && (*p) <= 46 )
1062
- goto st53;
1063
- } else if ( (*p) > 57 ) {
1064
- if ( 65 <= (*p) && (*p) <= 90 )
1065
- goto st53;
1066
- } else
1067
- goto st53;
1068
- goto st0;
1069
- st53:
1070
- if ( ++p == pe )
1071
- goto _test_eof53;
1072
- case 53:
1073
- switch( (*p) ) {
1074
- case 32: goto tr2;
1075
- case 36: goto st54;
1076
- case 95: goto st54;
1077
- }
1078
- if ( (*p) < 48 ) {
1079
- if ( 45 <= (*p) && (*p) <= 46 )
1080
- goto st54;
1081
- } else if ( (*p) > 57 ) {
1082
- if ( 65 <= (*p) && (*p) <= 90 )
1083
- goto st54;
1084
- } else
1085
- goto st54;
1086
- goto st0;
1087
- st54:
1088
- if ( ++p == pe )
1089
- goto _test_eof54;
1090
- case 54:
1091
- switch( (*p) ) {
1092
- case 32: goto tr2;
1093
- case 36: goto st55;
1094
- case 95: goto st55;
1095
- }
1096
- if ( (*p) < 48 ) {
1097
- if ( 45 <= (*p) && (*p) <= 46 )
1098
- goto st55;
1099
- } else if ( (*p) > 57 ) {
1100
- if ( 65 <= (*p) && (*p) <= 90 )
1101
- goto st55;
1102
- } else
1103
- goto st55;
1104
- goto st0;
1105
- st55:
1106
- if ( ++p == pe )
1107
- goto _test_eof55;
1108
- case 55:
1109
- switch( (*p) ) {
1110
- case 32: goto tr2;
1111
- case 36: goto st56;
1112
- case 95: goto st56;
1113
- }
1114
- if ( (*p) < 48 ) {
1115
- if ( 45 <= (*p) && (*p) <= 46 )
1116
- goto st56;
1117
- } else if ( (*p) > 57 ) {
1118
- if ( 65 <= (*p) && (*p) <= 90 )
1119
- goto st56;
1120
- } else
1121
- goto st56;
1122
- goto st0;
1123
- st56:
1124
- if ( ++p == pe )
1125
- goto _test_eof56;
1126
- case 56:
1127
981
  if ( (*p) == 32 )
1128
982
  goto tr2;
1129
983
  goto st0;
@@ -1143,7 +997,7 @@ case 56:
1143
997
  _test_eof14: cs = 14; goto _test_eof;
1144
998
  _test_eof15: cs = 15; goto _test_eof;
1145
999
  _test_eof16: cs = 16; goto _test_eof;
1146
- _test_eof57: cs = 57; goto _test_eof;
1000
+ _test_eof47: cs = 47; goto _test_eof;
1147
1001
  _test_eof17: cs = 17; goto _test_eof;
1148
1002
  _test_eof18: cs = 18; goto _test_eof;
1149
1003
  _test_eof19: cs = 19; goto _test_eof;
@@ -1174,22 +1028,12 @@ case 56:
1174
1028
  _test_eof44: cs = 44; goto _test_eof;
1175
1029
  _test_eof45: cs = 45; goto _test_eof;
1176
1030
  _test_eof46: cs = 46; goto _test_eof;
1177
- _test_eof47: cs = 47; goto _test_eof;
1178
- _test_eof48: cs = 48; goto _test_eof;
1179
- _test_eof49: cs = 49; goto _test_eof;
1180
- _test_eof50: cs = 50; goto _test_eof;
1181
- _test_eof51: cs = 51; goto _test_eof;
1182
- _test_eof52: cs = 52; goto _test_eof;
1183
- _test_eof53: cs = 53; goto _test_eof;
1184
- _test_eof54: cs = 54; goto _test_eof;
1185
- _test_eof55: cs = 55; goto _test_eof;
1186
- _test_eof56: cs = 56; goto _test_eof;
1187
1031
 
1188
1032
  _test_eof: {}
1189
1033
  _out: {}
1190
1034
  }
1191
1035
 
1192
- #line 114 "ext/http11/http11_parser.rl"
1036
+ #line 115 "ext/puma_http11/http11_parser.rl"
1193
1037
 
1194
1038
  if (!puma_parser_has_error(parser))
1195
1039
  parser->cs = cs;