puma 5.0.4 → 5.6.4
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.
- checksums.yaml +4 -4
- data/History.md +322 -48
- data/LICENSE +0 -0
- data/README.md +95 -24
- data/bin/puma-wild +0 -0
- data/docs/architecture.md +57 -20
- data/docs/compile_options.md +21 -0
- data/docs/deployment.md +53 -67
- data/docs/fork_worker.md +2 -0
- data/docs/images/puma-connection-flow-no-reactor.png +0 -0
- data/docs/images/puma-connection-flow.png +0 -0
- data/docs/images/puma-general-arch.png +0 -0
- data/docs/jungle/README.md +0 -0
- data/docs/jungle/rc.d/README.md +1 -1
- data/docs/jungle/rc.d/puma.conf +0 -0
- data/docs/kubernetes.md +66 -0
- data/docs/nginx.md +0 -0
- data/docs/plugins.md +15 -15
- data/docs/rails_dev_mode.md +28 -0
- data/docs/restart.md +7 -7
- data/docs/signals.md +11 -10
- data/docs/stats.md +142 -0
- data/docs/systemd.md +85 -66
- data/ext/puma_http11/PumaHttp11Service.java +0 -0
- data/ext/puma_http11/ext_help.h +0 -0
- data/ext/puma_http11/extconf.rb +42 -6
- data/ext/puma_http11/http11_parser.c +68 -57
- data/ext/puma_http11/http11_parser.h +1 -1
- data/ext/puma_http11/http11_parser.java.rl +1 -1
- data/ext/puma_http11/http11_parser.rl +1 -1
- data/ext/puma_http11/http11_parser_common.rl +1 -1
- data/ext/puma_http11/mini_ssl.c +226 -88
- data/ext/puma_http11/no_ssl/PumaHttp11Service.java +0 -0
- data/ext/puma_http11/org/jruby/puma/Http11.java +0 -0
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +51 -51
- data/ext/puma_http11/org/jruby/puma/MiniSSL.java +28 -43
- data/ext/puma_http11/puma_http11.c +9 -3
- data/lib/puma/app/status.rb +4 -7
- data/lib/puma/binder.rb +138 -49
- data/lib/puma/cli.rb +18 -4
- data/lib/puma/client.rb +113 -31
- data/lib/puma/cluster/worker.rb +22 -19
- data/lib/puma/cluster/worker_handle.rb +13 -2
- data/lib/puma/cluster.rb +75 -33
- data/lib/puma/commonlogger.rb +0 -0
- data/lib/puma/configuration.rb +21 -2
- data/lib/puma/const.rb +17 -8
- data/lib/puma/control_cli.rb +76 -71
- data/lib/puma/detect.rb +19 -9
- data/lib/puma/dsl.rb +225 -31
- data/lib/puma/error_logger.rb +12 -5
- data/lib/puma/events.rb +18 -3
- data/lib/puma/io_buffer.rb +0 -0
- data/lib/puma/jruby_restart.rb +0 -0
- data/lib/puma/json_serialization.rb +96 -0
- data/lib/puma/launcher.rb +56 -7
- data/lib/puma/minissl/context_builder.rb +14 -6
- data/lib/puma/minissl.rb +72 -40
- data/lib/puma/null_io.rb +12 -0
- data/lib/puma/plugin/tmp_restart.rb +0 -0
- data/lib/puma/plugin.rb +2 -2
- data/lib/puma/queue_close.rb +7 -7
- data/lib/puma/rack/builder.rb +1 -1
- data/lib/puma/rack/urlmap.rb +0 -0
- data/lib/puma/rack_default.rb +0 -0
- data/lib/puma/reactor.rb +19 -12
- data/lib/puma/request.rb +55 -21
- data/lib/puma/runner.rb +39 -13
- data/lib/puma/server.rb +78 -142
- data/lib/puma/single.rb +0 -0
- data/lib/puma/state_file.rb +45 -9
- data/lib/puma/systemd.rb +46 -0
- data/lib/puma/thread_pool.rb +11 -8
- data/lib/puma/util.rb +8 -1
- data/lib/puma.rb +36 -10
- data/lib/rack/handler/puma.rb +1 -0
- data/tools/Dockerfile +1 -1
- data/tools/trickletest.rb +0 -0
- metadata +15 -9
@@ -33,20 +33,18 @@ static void snake_upcase_char(char *c)
|
|
33
33
|
/** Machine **/
|
34
34
|
|
35
35
|
|
36
|
-
#line
|
36
|
+
#line 81 "ext/puma_http11/http11_parser.rl"
|
37
37
|
|
38
38
|
|
39
39
|
/** Data **/
|
40
40
|
|
41
|
-
#line
|
41
|
+
#line 42 "ext/puma_http11/http11_parser.c"
|
42
42
|
static const int puma_parser_start = 1;
|
43
43
|
static const int puma_parser_first_final = 46;
|
44
44
|
static const int puma_parser_error = 0;
|
45
45
|
|
46
|
-
static const int puma_parser_en_main = 1;
|
47
46
|
|
48
|
-
|
49
|
-
#line 83 "ext/puma_http11/http11_parser.rl"
|
47
|
+
#line 85 "ext/puma_http11/http11_parser.rl"
|
50
48
|
|
51
49
|
int puma_parser_init(puma_parser *parser) {
|
52
50
|
int cs = 0;
|
@@ -56,7 +54,7 @@ int puma_parser_init(puma_parser *parser) {
|
|
56
54
|
cs = puma_parser_start;
|
57
55
|
}
|
58
56
|
|
59
|
-
#line
|
57
|
+
#line 89 "ext/puma_http11/http11_parser.rl"
|
60
58
|
parser->cs = cs;
|
61
59
|
parser->body_start = 0;
|
62
60
|
parser->content_len = 0;
|
@@ -109,7 +107,7 @@ st0:
|
|
109
107
|
cs = 0;
|
110
108
|
goto _out;
|
111
109
|
tr0:
|
112
|
-
#line
|
110
|
+
#line 37 "ext/puma_http11/http11_parser.rl"
|
113
111
|
{ MARK(mark, p); }
|
114
112
|
goto st2;
|
115
113
|
st2:
|
@@ -132,7 +130,7 @@ case 2:
|
|
132
130
|
goto st27;
|
133
131
|
goto st0;
|
134
132
|
tr2:
|
135
|
-
#line
|
133
|
+
#line 50 "ext/puma_http11/http11_parser.rl"
|
136
134
|
{
|
137
135
|
parser->request_method(parser, PTR_TO(mark), LEN(mark, p));
|
138
136
|
}
|
@@ -158,7 +156,7 @@ case 3:
|
|
158
156
|
goto tr5;
|
159
157
|
goto st0;
|
160
158
|
tr4:
|
161
|
-
#line
|
159
|
+
#line 37 "ext/puma_http11/http11_parser.rl"
|
162
160
|
{ MARK(mark, p); }
|
163
161
|
goto st4;
|
164
162
|
st4:
|
@@ -172,53 +170,53 @@ case 4:
|
|
172
170
|
}
|
173
171
|
goto st0;
|
174
172
|
tr8:
|
175
|
-
#line
|
173
|
+
#line 53 "ext/puma_http11/http11_parser.rl"
|
176
174
|
{
|
177
175
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
178
176
|
}
|
179
177
|
goto st5;
|
180
178
|
tr31:
|
181
|
-
#line
|
179
|
+
#line 37 "ext/puma_http11/http11_parser.rl"
|
182
180
|
{ MARK(mark, p); }
|
183
|
-
#line
|
181
|
+
#line 56 "ext/puma_http11/http11_parser.rl"
|
184
182
|
{
|
185
183
|
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
|
186
184
|
}
|
187
185
|
goto st5;
|
188
186
|
tr33:
|
189
|
-
#line
|
187
|
+
#line 56 "ext/puma_http11/http11_parser.rl"
|
190
188
|
{
|
191
189
|
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
|
192
190
|
}
|
193
191
|
goto st5;
|
194
192
|
tr37:
|
195
|
-
#line
|
193
|
+
#line 69 "ext/puma_http11/http11_parser.rl"
|
196
194
|
{
|
197
195
|
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
198
196
|
}
|
199
|
-
#line
|
197
|
+
#line 53 "ext/puma_http11/http11_parser.rl"
|
200
198
|
{
|
201
199
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
202
200
|
}
|
203
201
|
goto st5;
|
204
202
|
tr41:
|
205
|
-
#line
|
203
|
+
#line 60 "ext/puma_http11/http11_parser.rl"
|
206
204
|
{ MARK(query_start, p); }
|
207
|
-
#line
|
205
|
+
#line 61 "ext/puma_http11/http11_parser.rl"
|
208
206
|
{
|
209
207
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
210
208
|
}
|
211
|
-
#line
|
209
|
+
#line 53 "ext/puma_http11/http11_parser.rl"
|
212
210
|
{
|
213
211
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
214
212
|
}
|
215
213
|
goto st5;
|
216
214
|
tr44:
|
217
|
-
#line
|
215
|
+
#line 61 "ext/puma_http11/http11_parser.rl"
|
218
216
|
{
|
219
217
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
220
218
|
}
|
221
|
-
#line
|
219
|
+
#line 53 "ext/puma_http11/http11_parser.rl"
|
222
220
|
{
|
223
221
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
224
222
|
}
|
@@ -232,7 +230,7 @@ case 5:
|
|
232
230
|
goto tr10;
|
233
231
|
goto st0;
|
234
232
|
tr10:
|
235
|
-
#line
|
233
|
+
#line 37 "ext/puma_http11/http11_parser.rl"
|
236
234
|
{ MARK(mark, p); }
|
237
235
|
goto st6;
|
238
236
|
st6:
|
@@ -297,21 +295,21 @@ case 13:
|
|
297
295
|
goto st13;
|
298
296
|
goto st0;
|
299
297
|
tr18:
|
300
|
-
#line
|
298
|
+
#line 65 "ext/puma_http11/http11_parser.rl"
|
301
299
|
{
|
302
300
|
parser->http_version(parser, PTR_TO(mark), LEN(mark, p));
|
303
301
|
}
|
304
302
|
goto st14;
|
305
303
|
tr26:
|
306
|
-
#line
|
304
|
+
#line 46 "ext/puma_http11/http11_parser.rl"
|
307
305
|
{ MARK(mark, p); }
|
308
|
-
#line
|
306
|
+
#line 47 "ext/puma_http11/http11_parser.rl"
|
309
307
|
{
|
310
308
|
parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
311
309
|
}
|
312
310
|
goto st14;
|
313
311
|
tr29:
|
314
|
-
#line
|
312
|
+
#line 47 "ext/puma_http11/http11_parser.rl"
|
315
313
|
{
|
316
314
|
parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
317
315
|
}
|
@@ -360,7 +358,7 @@ case 16:
|
|
360
358
|
goto tr22;
|
361
359
|
goto st0;
|
362
360
|
tr22:
|
363
|
-
#line
|
361
|
+
#line 73 "ext/puma_http11/http11_parser.rl"
|
364
362
|
{
|
365
363
|
parser->body_start = p - buffer + 1;
|
366
364
|
parser->header_done(parser, p + 1, pe - p - 1);
|
@@ -374,13 +372,13 @@ case 46:
|
|
374
372
|
#line 373 "ext/puma_http11/http11_parser.c"
|
375
373
|
goto st0;
|
376
374
|
tr21:
|
377
|
-
#line
|
375
|
+
#line 40 "ext/puma_http11/http11_parser.rl"
|
378
376
|
{ MARK(field_start, p); }
|
379
|
-
#line
|
377
|
+
#line 41 "ext/puma_http11/http11_parser.rl"
|
380
378
|
{ snake_upcase_char((char *)p); }
|
381
379
|
goto st17;
|
382
380
|
tr23:
|
383
|
-
#line
|
381
|
+
#line 41 "ext/puma_http11/http11_parser.rl"
|
384
382
|
{ snake_upcase_char((char *)p); }
|
385
383
|
goto st17;
|
386
384
|
st17:
|
@@ -413,13 +411,13 @@ case 17:
|
|
413
411
|
goto tr23;
|
414
412
|
goto st0;
|
415
413
|
tr24:
|
416
|
-
#line
|
414
|
+
#line 42 "ext/puma_http11/http11_parser.rl"
|
417
415
|
{
|
418
416
|
parser->field_len = LEN(field_start, p);
|
419
417
|
}
|
420
418
|
goto st18;
|
421
419
|
tr27:
|
422
|
-
#line
|
420
|
+
#line 46 "ext/puma_http11/http11_parser.rl"
|
423
421
|
{ MARK(mark, p); }
|
424
422
|
goto st18;
|
425
423
|
st18:
|
@@ -430,54 +428,67 @@ case 18:
|
|
430
428
|
switch( (*p) ) {
|
431
429
|
case 13: goto tr26;
|
432
430
|
case 32: goto tr27;
|
431
|
+
case 127: goto st0;
|
433
432
|
}
|
433
|
+
if ( (*p) > 8 ) {
|
434
|
+
if ( 10 <= (*p) && (*p) <= 31 )
|
435
|
+
goto st0;
|
436
|
+
} else if ( (*p) >= 0 )
|
437
|
+
goto st0;
|
434
438
|
goto tr25;
|
435
439
|
tr25:
|
436
|
-
#line
|
440
|
+
#line 46 "ext/puma_http11/http11_parser.rl"
|
437
441
|
{ MARK(mark, p); }
|
438
442
|
goto st19;
|
439
443
|
st19:
|
440
444
|
if ( ++p == pe )
|
441
445
|
goto _test_eof19;
|
442
446
|
case 19:
|
443
|
-
#line
|
444
|
-
|
445
|
-
goto tr29;
|
447
|
+
#line 448 "ext/puma_http11/http11_parser.c"
|
448
|
+
switch( (*p) ) {
|
449
|
+
case 13: goto tr29;
|
450
|
+
case 127: goto st0;
|
451
|
+
}
|
452
|
+
if ( (*p) > 8 ) {
|
453
|
+
if ( 10 <= (*p) && (*p) <= 31 )
|
454
|
+
goto st0;
|
455
|
+
} else if ( (*p) >= 0 )
|
456
|
+
goto st0;
|
446
457
|
goto st19;
|
447
458
|
tr9:
|
448
|
-
#line
|
459
|
+
#line 53 "ext/puma_http11/http11_parser.rl"
|
449
460
|
{
|
450
461
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
451
462
|
}
|
452
463
|
goto st20;
|
453
464
|
tr38:
|
454
|
-
#line
|
465
|
+
#line 69 "ext/puma_http11/http11_parser.rl"
|
455
466
|
{
|
456
467
|
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
457
468
|
}
|
458
|
-
#line
|
469
|
+
#line 53 "ext/puma_http11/http11_parser.rl"
|
459
470
|
{
|
460
471
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
461
472
|
}
|
462
473
|
goto st20;
|
463
474
|
tr42:
|
464
|
-
#line
|
475
|
+
#line 60 "ext/puma_http11/http11_parser.rl"
|
465
476
|
{ MARK(query_start, p); }
|
466
|
-
#line
|
477
|
+
#line 61 "ext/puma_http11/http11_parser.rl"
|
467
478
|
{
|
468
479
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
469
480
|
}
|
470
|
-
#line
|
481
|
+
#line 53 "ext/puma_http11/http11_parser.rl"
|
471
482
|
{
|
472
483
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
473
484
|
}
|
474
485
|
goto st20;
|
475
486
|
tr45:
|
476
|
-
#line
|
487
|
+
#line 61 "ext/puma_http11/http11_parser.rl"
|
477
488
|
{
|
478
489
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
479
490
|
}
|
480
|
-
#line
|
491
|
+
#line 53 "ext/puma_http11/http11_parser.rl"
|
481
492
|
{
|
482
493
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
483
494
|
}
|
@@ -486,7 +497,7 @@ st20:
|
|
486
497
|
if ( ++p == pe )
|
487
498
|
goto _test_eof20;
|
488
499
|
case 20:
|
489
|
-
#line
|
500
|
+
#line 501 "ext/puma_http11/http11_parser.c"
|
490
501
|
switch( (*p) ) {
|
491
502
|
case 32: goto tr31;
|
492
503
|
case 60: goto st0;
|
@@ -500,14 +511,14 @@ case 20:
|
|
500
511
|
goto st0;
|
501
512
|
goto tr30;
|
502
513
|
tr30:
|
503
|
-
#line
|
514
|
+
#line 37 "ext/puma_http11/http11_parser.rl"
|
504
515
|
{ MARK(mark, p); }
|
505
516
|
goto st21;
|
506
517
|
st21:
|
507
518
|
if ( ++p == pe )
|
508
519
|
goto _test_eof21;
|
509
520
|
case 21:
|
510
|
-
#line
|
521
|
+
#line 522 "ext/puma_http11/http11_parser.c"
|
511
522
|
switch( (*p) ) {
|
512
523
|
case 32: goto tr33;
|
513
524
|
case 60: goto st0;
|
@@ -521,14 +532,14 @@ case 21:
|
|
521
532
|
goto st0;
|
522
533
|
goto st21;
|
523
534
|
tr5:
|
524
|
-
#line
|
535
|
+
#line 37 "ext/puma_http11/http11_parser.rl"
|
525
536
|
{ MARK(mark, p); }
|
526
537
|
goto st22;
|
527
538
|
st22:
|
528
539
|
if ( ++p == pe )
|
529
540
|
goto _test_eof22;
|
530
541
|
case 22:
|
531
|
-
#line
|
542
|
+
#line 543 "ext/puma_http11/http11_parser.c"
|
532
543
|
switch( (*p) ) {
|
533
544
|
case 43: goto st22;
|
534
545
|
case 58: goto st23;
|
@@ -546,14 +557,14 @@ case 22:
|
|
546
557
|
goto st22;
|
547
558
|
goto st0;
|
548
559
|
tr7:
|
549
|
-
#line
|
560
|
+
#line 37 "ext/puma_http11/http11_parser.rl"
|
550
561
|
{ MARK(mark, p); }
|
551
562
|
goto st23;
|
552
563
|
st23:
|
553
564
|
if ( ++p == pe )
|
554
565
|
goto _test_eof23;
|
555
566
|
case 23:
|
556
|
-
#line
|
567
|
+
#line 568 "ext/puma_http11/http11_parser.c"
|
557
568
|
switch( (*p) ) {
|
558
569
|
case 32: goto tr8;
|
559
570
|
case 34: goto st0;
|
@@ -566,14 +577,14 @@ case 23:
|
|
566
577
|
goto st0;
|
567
578
|
goto st23;
|
568
579
|
tr6:
|
569
|
-
#line
|
580
|
+
#line 37 "ext/puma_http11/http11_parser.rl"
|
570
581
|
{ MARK(mark, p); }
|
571
582
|
goto st24;
|
572
583
|
st24:
|
573
584
|
if ( ++p == pe )
|
574
585
|
goto _test_eof24;
|
575
586
|
case 24:
|
576
|
-
#line
|
587
|
+
#line 588 "ext/puma_http11/http11_parser.c"
|
577
588
|
switch( (*p) ) {
|
578
589
|
case 32: goto tr37;
|
579
590
|
case 34: goto st0;
|
@@ -587,7 +598,7 @@ case 24:
|
|
587
598
|
goto st0;
|
588
599
|
goto st24;
|
589
600
|
tr39:
|
590
|
-
#line
|
601
|
+
#line 69 "ext/puma_http11/http11_parser.rl"
|
591
602
|
{
|
592
603
|
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
593
604
|
}
|
@@ -596,7 +607,7 @@ st25:
|
|
596
607
|
if ( ++p == pe )
|
597
608
|
goto _test_eof25;
|
598
609
|
case 25:
|
599
|
-
#line
|
610
|
+
#line 611 "ext/puma_http11/http11_parser.c"
|
600
611
|
switch( (*p) ) {
|
601
612
|
case 32: goto tr41;
|
602
613
|
case 34: goto st0;
|
@@ -609,14 +620,14 @@ case 25:
|
|
609
620
|
goto st0;
|
610
621
|
goto tr40;
|
611
622
|
tr40:
|
612
|
-
#line
|
623
|
+
#line 60 "ext/puma_http11/http11_parser.rl"
|
613
624
|
{ MARK(query_start, p); }
|
614
625
|
goto st26;
|
615
626
|
st26:
|
616
627
|
if ( ++p == pe )
|
617
628
|
goto _test_eof26;
|
618
629
|
case 26:
|
619
|
-
#line
|
630
|
+
#line 631 "ext/puma_http11/http11_parser.c"
|
620
631
|
switch( (*p) ) {
|
621
632
|
case 32: goto tr44;
|
622
633
|
case 34: goto st0;
|
@@ -1010,7 +1021,7 @@ case 45:
|
|
1010
1021
|
_out: {}
|
1011
1022
|
}
|
1012
1023
|
|
1013
|
-
#line
|
1024
|
+
#line 117 "ext/puma_http11/http11_parser.rl"
|
1014
1025
|
|
1015
1026
|
if (!puma_parser_has_error(parser))
|
1016
1027
|
parser->cs = cs;
|
@@ -43,7 +43,7 @@
|
|
43
43
|
|
44
44
|
field_name = ( token -- ":" )+ >start_field $snake_upcase_field %write_field;
|
45
45
|
|
46
|
-
field_value = any* >start_value %write_value;
|
46
|
+
field_value = ( (any -- CTL) | "\t" )* >start_value %write_value;
|
47
47
|
|
48
48
|
message_header = field_name ":" " "* field_value :> CRLF;
|
49
49
|
|