unicorn 5.4.1 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.manifest +10 -5
- data/.olddoc.yml +15 -7
- data/Application_Timeouts +4 -4
- data/CONTRIBUTORS +6 -2
- data/Documentation/.gitignore +1 -3
- data/Documentation/unicorn.1 +222 -0
- data/Documentation/unicorn_rails.1 +207 -0
- data/FAQ +1 -1
- data/GIT-VERSION-FILE +1 -1
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +112 -57
- data/HACKING +2 -9
- data/ISSUES +29 -33
- data/KNOWN_ISSUES +2 -2
- data/LATEST +16 -21
- data/LICENSE +2 -2
- data/Links +13 -11
- data/NEWS +197 -0
- data/README +27 -14
- data/SIGNALS +1 -1
- data/Sandbox +5 -5
- data/archive/slrnpull.conf +1 -1
- data/bin/unicorn +3 -1
- data/bin/unicorn_rails +2 -2
- data/examples/big_app_gc.rb +1 -1
- data/examples/logrotate.conf +3 -3
- data/examples/nginx.conf +4 -3
- data/examples/unicorn.conf.minimal.rb +2 -2
- data/examples/unicorn.conf.rb +2 -2
- data/examples/unicorn@.service +7 -0
- data/ext/unicorn_http/c_util.h +5 -13
- data/ext/unicorn_http/common_field_optimization.h +23 -6
- data/ext/unicorn_http/epollexclusive.h +124 -0
- data/ext/unicorn_http/ext_help.h +0 -24
- data/ext/unicorn_http/extconf.rb +32 -6
- data/ext/unicorn_http/global_variables.h +3 -3
- data/ext/unicorn_http/httpdate.c +3 -2
- data/ext/unicorn_http/unicorn_http.c +262 -237
- data/ext/unicorn_http/unicorn_http.rl +52 -27
- data/lib/unicorn/configurator.rb +25 -4
- data/lib/unicorn/http_request.rb +12 -3
- data/lib/unicorn/http_server.rb +62 -36
- data/lib/unicorn/launcher.rb +1 -1
- data/lib/unicorn/oob_gc.rb +5 -5
- data/lib/unicorn/select_waiter.rb +6 -0
- data/lib/unicorn/socket_helper.rb +1 -0
- data/lib/unicorn/tmpio.rb +8 -2
- data/lib/unicorn/util.rb +1 -1
- data/lib/unicorn/version.rb +1 -1
- data/lib/unicorn/worker.rb +16 -2
- data/lib/unicorn.rb +21 -9
- data/man/man1/unicorn.1 +89 -88
- data/man/man1/unicorn_rails.1 +78 -83
- data/t/GNUmakefile +3 -72
- data/t/README +4 -4
- data/t/t0301-no-default-middleware-ignored-in-config.sh +25 -0
- data/t/t0301.ru +13 -0
- data/t/test-lib.sh +2 -1
- data/test/benchmark/README +14 -4
- data/test/benchmark/ddstream.ru +50 -0
- data/test/benchmark/readinput.ru +40 -0
- data/test/benchmark/uconnect.perl +66 -0
- data/test/exec/test_exec.rb +14 -12
- data/test/test_helper.rb +38 -30
- data/test/unit/test_ccc.rb +4 -3
- data/test/unit/test_http_parser.rb +16 -0
- data/test/unit/test_http_parser_ng.rb +81 -0
- data/test/unit/test_server.rb +81 -7
- data/test/unit/test_signals.rb +6 -6
- data/test/unit/test_socket_helper.rb +1 -1
- data/test/unit/test_upload.rb +9 -14
- data/test/unit/test_util.rb +29 -3
- data/test/unit/test_waiter.rb +34 -0
- data/unicorn.gemspec +8 -7
- metadata +19 -13
- data/Documentation/GNUmakefile +0 -30
- data/Documentation/unicorn.1.txt +0 -187
- data/Documentation/unicorn_rails.1.txt +0 -175
- data/t/hijack.ru +0 -55
- data/t/t0200-rack-hijack.sh +0 -51
@@ -14,8 +14,9 @@
|
|
14
14
|
#include "common_field_optimization.h"
|
15
15
|
#include "global_variables.h"
|
16
16
|
#include "c_util.h"
|
17
|
+
#include "epollexclusive.h"
|
17
18
|
|
18
|
-
void init_unicorn_httpdate(
|
19
|
+
void init_unicorn_httpdate(void);
|
19
20
|
|
20
21
|
#define UH_FL_CHUNKED 0x1
|
21
22
|
#define UH_FL_HASBODY 0x2
|
@@ -64,19 +65,8 @@ struct http_parser {
|
|
64
65
|
} len;
|
65
66
|
};
|
66
67
|
|
67
|
-
static ID id_set_backtrace;
|
68
|
-
|
69
|
-
#ifdef HAVE_RB_HASH_CLEAR /* Ruby >= 2.0 */
|
70
|
-
# define my_hash_clear(h) (void)rb_hash_clear(h)
|
71
|
-
#else /* !HAVE_RB_HASH_CLEAR - Ruby <= 1.9.3 */
|
72
|
-
|
73
|
-
static ID id_clear;
|
74
|
-
|
75
|
-
static void my_hash_clear(VALUE h)
|
76
|
-
{
|
77
|
-
rb_funcall(h, id_clear, 0);
|
78
|
-
}
|
79
|
-
#endif /* HAVE_RB_HASH_CLEAR */
|
68
|
+
static ID id_set_backtrace, id_is_chunked_p;
|
69
|
+
static VALUE cHttpParser;
|
80
70
|
|
81
71
|
static void finalize_header(struct http_parser *hp);
|
82
72
|
|
@@ -222,6 +212,19 @@ static void write_cont_value(struct http_parser *hp,
|
|
222
212
|
rb_str_buf_cat(hp->cont, vptr, end + 1);
|
223
213
|
}
|
224
214
|
|
215
|
+
static int is_chunked(VALUE v)
|
216
|
+
{
|
217
|
+
/* common case first */
|
218
|
+
if (STR_CSTR_CASE_EQ(v, "chunked"))
|
219
|
+
return 1;
|
220
|
+
|
221
|
+
/*
|
222
|
+
* call Ruby function in unicorn/http_request.rb to deal with unlikely
|
223
|
+
* comma-delimited case
|
224
|
+
*/
|
225
|
+
return rb_funcall(cHttpParser, id_is_chunked_p, 1, v) != Qfalse;
|
226
|
+
}
|
227
|
+
|
225
228
|
static void write_value(struct http_parser *hp,
|
226
229
|
const char *buffer, const char *p)
|
227
230
|
{
|
@@ -248,7 +251,9 @@ static void write_value(struct http_parser *hp,
|
|
248
251
|
f = uncommon_field(field, flen);
|
249
252
|
} else if (f == g_http_connection) {
|
250
253
|
hp_keepalive_connection(hp, v);
|
251
|
-
} else if (f == g_content_length) {
|
254
|
+
} else if (f == g_content_length && !HP_FL_TEST(hp, CHUNKED)) {
|
255
|
+
if (hp->len.content)
|
256
|
+
parser_raise(eHttpParserError, "Content-Length already set");
|
252
257
|
hp->len.content = parse_length(RSTRING_PTR(v), RSTRING_LEN(v));
|
253
258
|
if (hp->len.content < 0)
|
254
259
|
parser_raise(eHttpParserError, "invalid Content-Length");
|
@@ -256,9 +261,30 @@ static void write_value(struct http_parser *hp,
|
|
256
261
|
HP_FL_SET(hp, HASBODY);
|
257
262
|
hp_invalid_if_trailer(hp);
|
258
263
|
} else if (f == g_http_transfer_encoding) {
|
259
|
-
if (
|
264
|
+
if (is_chunked(v)) {
|
265
|
+
if (HP_FL_TEST(hp, CHUNKED))
|
266
|
+
/*
|
267
|
+
* RFC 7230 3.3.1:
|
268
|
+
* A sender MUST NOT apply chunked more than once to a message body
|
269
|
+
* (i.e., chunking an already chunked message is not allowed).
|
270
|
+
*/
|
271
|
+
parser_raise(eHttpParserError, "Transfer-Encoding double chunked");
|
272
|
+
|
260
273
|
HP_FL_SET(hp, CHUNKED);
|
261
274
|
HP_FL_SET(hp, HASBODY);
|
275
|
+
|
276
|
+
/* RFC 7230 3.3.3, 3: favor chunked if Content-Length exists */
|
277
|
+
hp->len.content = 0;
|
278
|
+
} else if (HP_FL_TEST(hp, CHUNKED)) {
|
279
|
+
/*
|
280
|
+
* RFC 7230 3.3.3, point 3 states:
|
281
|
+
* If a Transfer-Encoding header field is present in a request and
|
282
|
+
* the chunked transfer coding is not the final encoding, the
|
283
|
+
* message body length cannot be determined reliably; the server
|
284
|
+
* MUST respond with the 400 (Bad Request) status code and then
|
285
|
+
* close the connection.
|
286
|
+
*/
|
287
|
+
parser_raise(eHttpParserError, "invalid Transfer-Encoding");
|
262
288
|
}
|
263
289
|
hp_invalid_if_trailer(hp);
|
264
290
|
} else if (f == g_http_trailer) {
|
@@ -287,12 +313,12 @@ static void write_value(struct http_parser *hp,
|
|
287
313
|
/** Machine **/
|
288
314
|
|
289
315
|
|
290
|
-
#line
|
316
|
+
#line 420 "unicorn_http.rl"
|
291
317
|
|
292
318
|
|
293
319
|
/** Data **/
|
294
320
|
|
295
|
-
#line
|
321
|
+
#line 322 "unicorn_http.c"
|
296
322
|
static const int http_parser_start = 1;
|
297
323
|
static const int http_parser_first_final = 122;
|
298
324
|
static const int http_parser_error = 0;
|
@@ -303,7 +329,7 @@ static const int http_parser_en_Trailers = 114;
|
|
303
329
|
static const int http_parser_en_main = 1;
|
304
330
|
|
305
331
|
|
306
|
-
#line
|
332
|
+
#line 424 "unicorn_http.rl"
|
307
333
|
|
308
334
|
static void http_parser_init(struct http_parser *hp)
|
309
335
|
{
|
@@ -316,12 +342,12 @@ static void http_parser_init(struct http_parser *hp)
|
|
316
342
|
hp->len.content = 0;
|
317
343
|
hp->cont = Qfalse; /* zero on MRI, should be optimized away by above */
|
318
344
|
|
319
|
-
#line
|
345
|
+
#line 346 "unicorn_http.c"
|
320
346
|
{
|
321
347
|
cs = http_parser_start;
|
322
348
|
}
|
323
349
|
|
324
|
-
#line
|
350
|
+
#line 436 "unicorn_http.rl"
|
325
351
|
hp->cs = cs;
|
326
352
|
}
|
327
353
|
|
@@ -349,7 +375,7 @@ http_parser_execute(struct http_parser *hp, char *buffer, size_t len)
|
|
349
375
|
goto skip_chunk_data_hack;
|
350
376
|
}
|
351
377
|
|
352
|
-
#line
|
378
|
+
#line 379 "unicorn_http.c"
|
353
379
|
{
|
354
380
|
if ( p == pe )
|
355
381
|
goto _test_eof;
|
@@ -384,14 +410,14 @@ st0:
|
|
384
410
|
cs = 0;
|
385
411
|
goto _out;
|
386
412
|
tr0:
|
387
|
-
#line
|
413
|
+
#line 316 "unicorn_http.rl"
|
388
414
|
{MARK(mark, p); }
|
389
415
|
goto st2;
|
390
416
|
st2:
|
391
417
|
if ( ++p == pe )
|
392
418
|
goto _test_eof2;
|
393
419
|
case 2:
|
394
|
-
#line
|
420
|
+
#line 421 "unicorn_http.c"
|
395
421
|
switch( (*p) ) {
|
396
422
|
case 32: goto tr3;
|
397
423
|
case 33: goto st49;
|
@@ -417,14 +443,14 @@ case 2:
|
|
417
443
|
goto st49;
|
418
444
|
goto st0;
|
419
445
|
tr3:
|
420
|
-
#line
|
446
|
+
#line 325 "unicorn_http.rl"
|
421
447
|
{ request_method(hp, PTR_TO(mark), LEN(mark, p)); }
|
422
448
|
goto st3;
|
423
449
|
st3:
|
424
450
|
if ( ++p == pe )
|
425
451
|
goto _test_eof3;
|
426
452
|
case 3:
|
427
|
-
#line
|
453
|
+
#line 454 "unicorn_http.c"
|
428
454
|
switch( (*p) ) {
|
429
455
|
case 42: goto tr5;
|
430
456
|
case 47: goto tr6;
|
@@ -433,21 +459,21 @@ case 3:
|
|
433
459
|
}
|
434
460
|
goto st0;
|
435
461
|
tr5:
|
436
|
-
#line
|
462
|
+
#line 316 "unicorn_http.rl"
|
437
463
|
{MARK(mark, p); }
|
438
464
|
goto st4;
|
439
465
|
st4:
|
440
466
|
if ( ++p == pe )
|
441
467
|
goto _test_eof4;
|
442
468
|
case 4:
|
443
|
-
#line
|
469
|
+
#line 470 "unicorn_http.c"
|
444
470
|
switch( (*p) ) {
|
445
471
|
case 32: goto tr8;
|
446
472
|
case 35: goto tr9;
|
447
473
|
}
|
448
474
|
goto st0;
|
449
475
|
tr8:
|
450
|
-
#line
|
476
|
+
#line 330 "unicorn_http.rl"
|
451
477
|
{
|
452
478
|
VALUE str;
|
453
479
|
|
@@ -465,23 +491,23 @@ tr8:
|
|
465
491
|
}
|
466
492
|
goto st5;
|
467
493
|
tr42:
|
468
|
-
#line
|
494
|
+
#line 316 "unicorn_http.rl"
|
469
495
|
{MARK(mark, p); }
|
470
|
-
#line
|
496
|
+
#line 345 "unicorn_http.rl"
|
471
497
|
{
|
472
498
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
473
499
|
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
474
500
|
}
|
475
501
|
goto st5;
|
476
502
|
tr45:
|
477
|
-
#line
|
503
|
+
#line 345 "unicorn_http.rl"
|
478
504
|
{
|
479
505
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
480
506
|
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
481
507
|
}
|
482
508
|
goto st5;
|
483
509
|
tr49:
|
484
|
-
#line
|
510
|
+
#line 355 "unicorn_http.rl"
|
485
511
|
{
|
486
512
|
VALUE val;
|
487
513
|
|
@@ -492,7 +518,7 @@ tr49:
|
|
492
518
|
if (!STR_CSTR_EQ(val, "*"))
|
493
519
|
rb_hash_aset(hp->env, g_path_info, val);
|
494
520
|
}
|
495
|
-
#line
|
521
|
+
#line 330 "unicorn_http.rl"
|
496
522
|
{
|
497
523
|
VALUE str;
|
498
524
|
|
@@ -510,14 +536,14 @@ tr49:
|
|
510
536
|
}
|
511
537
|
goto st5;
|
512
538
|
tr55:
|
513
|
-
#line
|
539
|
+
#line 349 "unicorn_http.rl"
|
514
540
|
{MARK(start.query, p); }
|
515
|
-
#line
|
541
|
+
#line 350 "unicorn_http.rl"
|
516
542
|
{
|
517
543
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
518
544
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
519
545
|
}
|
520
|
-
#line
|
546
|
+
#line 330 "unicorn_http.rl"
|
521
547
|
{
|
522
548
|
VALUE str;
|
523
549
|
|
@@ -535,12 +561,12 @@ tr55:
|
|
535
561
|
}
|
536
562
|
goto st5;
|
537
563
|
tr59:
|
538
|
-
#line
|
564
|
+
#line 350 "unicorn_http.rl"
|
539
565
|
{
|
540
566
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
541
567
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
542
568
|
}
|
543
|
-
#line
|
569
|
+
#line 330 "unicorn_http.rl"
|
544
570
|
{
|
545
571
|
VALUE str;
|
546
572
|
|
@@ -561,19 +587,19 @@ st5:
|
|
561
587
|
if ( ++p == pe )
|
562
588
|
goto _test_eof5;
|
563
589
|
case 5:
|
564
|
-
#line
|
590
|
+
#line 591 "unicorn_http.c"
|
565
591
|
if ( (*p) == 72 )
|
566
592
|
goto tr10;
|
567
593
|
goto st0;
|
568
594
|
tr10:
|
569
|
-
#line
|
595
|
+
#line 316 "unicorn_http.rl"
|
570
596
|
{MARK(mark, p); }
|
571
597
|
goto st6;
|
572
598
|
st6:
|
573
599
|
if ( ++p == pe )
|
574
600
|
goto _test_eof6;
|
575
601
|
case 6:
|
576
|
-
#line
|
602
|
+
#line 603 "unicorn_http.c"
|
577
603
|
if ( (*p) == 84 )
|
578
604
|
goto st7;
|
579
605
|
goto st0;
|
@@ -633,34 +659,34 @@ case 13:
|
|
633
659
|
goto st13;
|
634
660
|
goto st0;
|
635
661
|
tr18:
|
636
|
-
#line
|
662
|
+
#line 354 "unicorn_http.rl"
|
637
663
|
{ http_version(hp, PTR_TO(mark), LEN(mark, p)); }
|
638
664
|
goto st14;
|
639
665
|
tr26:
|
640
|
-
#line
|
666
|
+
#line 322 "unicorn_http.rl"
|
641
667
|
{ MARK(mark, p); }
|
642
|
-
#line
|
668
|
+
#line 324 "unicorn_http.rl"
|
643
669
|
{ write_cont_value(hp, buffer, p); }
|
644
670
|
goto st14;
|
645
671
|
tr29:
|
646
|
-
#line
|
672
|
+
#line 324 "unicorn_http.rl"
|
647
673
|
{ write_cont_value(hp, buffer, p); }
|
648
674
|
goto st14;
|
649
675
|
tr36:
|
650
|
-
#line
|
676
|
+
#line 322 "unicorn_http.rl"
|
651
677
|
{ MARK(mark, p); }
|
652
|
-
#line
|
678
|
+
#line 323 "unicorn_http.rl"
|
653
679
|
{ write_value(hp, buffer, p); }
|
654
680
|
goto st14;
|
655
681
|
tr39:
|
656
|
-
#line
|
682
|
+
#line 323 "unicorn_http.rl"
|
657
683
|
{ write_value(hp, buffer, p); }
|
658
684
|
goto st14;
|
659
685
|
st14:
|
660
686
|
if ( ++p == pe )
|
661
687
|
goto _test_eof14;
|
662
688
|
case 14:
|
663
|
-
#line
|
689
|
+
#line 690 "unicorn_http.c"
|
664
690
|
switch( (*p) ) {
|
665
691
|
case 9: goto st15;
|
666
692
|
case 10: goto tr21;
|
@@ -689,14 +715,14 @@ case 14:
|
|
689
715
|
goto tr23;
|
690
716
|
goto st0;
|
691
717
|
tr25:
|
692
|
-
#line
|
718
|
+
#line 322 "unicorn_http.rl"
|
693
719
|
{ MARK(mark, p); }
|
694
720
|
goto st15;
|
695
721
|
st15:
|
696
722
|
if ( ++p == pe )
|
697
723
|
goto _test_eof15;
|
698
724
|
case 15:
|
699
|
-
#line
|
725
|
+
#line 726 "unicorn_http.c"
|
700
726
|
switch( (*p) ) {
|
701
727
|
case 9: goto tr25;
|
702
728
|
case 10: goto tr26;
|
@@ -708,14 +734,14 @@ case 15:
|
|
708
734
|
goto st0;
|
709
735
|
goto tr24;
|
710
736
|
tr24:
|
711
|
-
#line
|
737
|
+
#line 322 "unicorn_http.rl"
|
712
738
|
{ MARK(mark, p); }
|
713
739
|
goto st16;
|
714
740
|
st16:
|
715
741
|
if ( ++p == pe )
|
716
742
|
goto _test_eof16;
|
717
743
|
case 16:
|
718
|
-
#line
|
744
|
+
#line 745 "unicorn_http.c"
|
719
745
|
switch( (*p) ) {
|
720
746
|
case 10: goto tr29;
|
721
747
|
case 13: goto tr30;
|
@@ -728,39 +754,39 @@ case 16:
|
|
728
754
|
goto st0;
|
729
755
|
goto st16;
|
730
756
|
tr19:
|
731
|
-
#line
|
757
|
+
#line 354 "unicorn_http.rl"
|
732
758
|
{ http_version(hp, PTR_TO(mark), LEN(mark, p)); }
|
733
759
|
goto st17;
|
734
760
|
tr27:
|
735
|
-
#line
|
761
|
+
#line 322 "unicorn_http.rl"
|
736
762
|
{ MARK(mark, p); }
|
737
|
-
#line
|
763
|
+
#line 324 "unicorn_http.rl"
|
738
764
|
{ write_cont_value(hp, buffer, p); }
|
739
765
|
goto st17;
|
740
766
|
tr30:
|
741
|
-
#line
|
767
|
+
#line 324 "unicorn_http.rl"
|
742
768
|
{ write_cont_value(hp, buffer, p); }
|
743
769
|
goto st17;
|
744
770
|
tr37:
|
745
|
-
#line
|
771
|
+
#line 322 "unicorn_http.rl"
|
746
772
|
{ MARK(mark, p); }
|
747
|
-
#line
|
773
|
+
#line 323 "unicorn_http.rl"
|
748
774
|
{ write_value(hp, buffer, p); }
|
749
775
|
goto st17;
|
750
776
|
tr40:
|
751
|
-
#line
|
777
|
+
#line 323 "unicorn_http.rl"
|
752
778
|
{ write_value(hp, buffer, p); }
|
753
779
|
goto st17;
|
754
780
|
st17:
|
755
781
|
if ( ++p == pe )
|
756
782
|
goto _test_eof17;
|
757
783
|
case 17:
|
758
|
-
#line
|
784
|
+
#line 785 "unicorn_http.c"
|
759
785
|
if ( (*p) == 10 )
|
760
786
|
goto st14;
|
761
787
|
goto st0;
|
762
788
|
tr21:
|
763
|
-
#line
|
789
|
+
#line 370 "unicorn_http.rl"
|
764
790
|
{
|
765
791
|
finalize_header(hp);
|
766
792
|
|
@@ -781,7 +807,7 @@ tr21:
|
|
781
807
|
}
|
782
808
|
goto st122;
|
783
809
|
tr104:
|
784
|
-
#line
|
810
|
+
#line 330 "unicorn_http.rl"
|
785
811
|
{
|
786
812
|
VALUE str;
|
787
813
|
|
@@ -797,7 +823,7 @@ tr104:
|
|
797
823
|
rb_hash_aset(hp->env, g_request_path, str);
|
798
824
|
}
|
799
825
|
}
|
800
|
-
#line
|
826
|
+
#line 370 "unicorn_http.rl"
|
801
827
|
{
|
802
828
|
finalize_header(hp);
|
803
829
|
|
@@ -818,14 +844,14 @@ tr104:
|
|
818
844
|
}
|
819
845
|
goto st122;
|
820
846
|
tr108:
|
821
|
-
#line
|
847
|
+
#line 316 "unicorn_http.rl"
|
822
848
|
{MARK(mark, p); }
|
823
|
-
#line
|
849
|
+
#line 345 "unicorn_http.rl"
|
824
850
|
{
|
825
851
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
826
852
|
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
827
853
|
}
|
828
|
-
#line
|
854
|
+
#line 370 "unicorn_http.rl"
|
829
855
|
{
|
830
856
|
finalize_header(hp);
|
831
857
|
|
@@ -846,12 +872,12 @@ tr108:
|
|
846
872
|
}
|
847
873
|
goto st122;
|
848
874
|
tr112:
|
849
|
-
#line
|
875
|
+
#line 345 "unicorn_http.rl"
|
850
876
|
{
|
851
877
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
852
878
|
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
853
879
|
}
|
854
|
-
#line
|
880
|
+
#line 370 "unicorn_http.rl"
|
855
881
|
{
|
856
882
|
finalize_header(hp);
|
857
883
|
|
@@ -872,7 +898,7 @@ tr112:
|
|
872
898
|
}
|
873
899
|
goto st122;
|
874
900
|
tr117:
|
875
|
-
#line
|
901
|
+
#line 355 "unicorn_http.rl"
|
876
902
|
{
|
877
903
|
VALUE val;
|
878
904
|
|
@@ -883,7 +909,7 @@ tr117:
|
|
883
909
|
if (!STR_CSTR_EQ(val, "*"))
|
884
910
|
rb_hash_aset(hp->env, g_path_info, val);
|
885
911
|
}
|
886
|
-
#line
|
912
|
+
#line 330 "unicorn_http.rl"
|
887
913
|
{
|
888
914
|
VALUE str;
|
889
915
|
|
@@ -899,7 +925,7 @@ tr117:
|
|
899
925
|
rb_hash_aset(hp->env, g_request_path, str);
|
900
926
|
}
|
901
927
|
}
|
902
|
-
#line
|
928
|
+
#line 370 "unicorn_http.rl"
|
903
929
|
{
|
904
930
|
finalize_header(hp);
|
905
931
|
|
@@ -920,14 +946,14 @@ tr117:
|
|
920
946
|
}
|
921
947
|
goto st122;
|
922
948
|
tr124:
|
923
|
-
#line
|
949
|
+
#line 349 "unicorn_http.rl"
|
924
950
|
{MARK(start.query, p); }
|
925
|
-
#line
|
951
|
+
#line 350 "unicorn_http.rl"
|
926
952
|
{
|
927
953
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
928
954
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
929
955
|
}
|
930
|
-
#line
|
956
|
+
#line 330 "unicorn_http.rl"
|
931
957
|
{
|
932
958
|
VALUE str;
|
933
959
|
|
@@ -943,7 +969,7 @@ tr124:
|
|
943
969
|
rb_hash_aset(hp->env, g_request_path, str);
|
944
970
|
}
|
945
971
|
}
|
946
|
-
#line
|
972
|
+
#line 370 "unicorn_http.rl"
|
947
973
|
{
|
948
974
|
finalize_header(hp);
|
949
975
|
|
@@ -964,12 +990,12 @@ tr124:
|
|
964
990
|
}
|
965
991
|
goto st122;
|
966
992
|
tr129:
|
967
|
-
#line
|
993
|
+
#line 350 "unicorn_http.rl"
|
968
994
|
{
|
969
995
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
970
996
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
971
997
|
}
|
972
|
-
#line
|
998
|
+
#line 330 "unicorn_http.rl"
|
973
999
|
{
|
974
1000
|
VALUE str;
|
975
1001
|
|
@@ -985,7 +1011,7 @@ tr129:
|
|
985
1011
|
rb_hash_aset(hp->env, g_request_path, str);
|
986
1012
|
}
|
987
1013
|
}
|
988
|
-
#line
|
1014
|
+
#line 370 "unicorn_http.rl"
|
989
1015
|
{
|
990
1016
|
finalize_header(hp);
|
991
1017
|
|
@@ -1009,10 +1035,10 @@ st122:
|
|
1009
1035
|
if ( ++p == pe )
|
1010
1036
|
goto _test_eof122;
|
1011
1037
|
case 122:
|
1012
|
-
#line
|
1038
|
+
#line 1039 "unicorn_http.c"
|
1013
1039
|
goto st0;
|
1014
1040
|
tr105:
|
1015
|
-
#line
|
1041
|
+
#line 330 "unicorn_http.rl"
|
1016
1042
|
{
|
1017
1043
|
VALUE str;
|
1018
1044
|
|
@@ -1030,23 +1056,23 @@ tr105:
|
|
1030
1056
|
}
|
1031
1057
|
goto st18;
|
1032
1058
|
tr109:
|
1033
|
-
#line
|
1059
|
+
#line 316 "unicorn_http.rl"
|
1034
1060
|
{MARK(mark, p); }
|
1035
|
-
#line
|
1061
|
+
#line 345 "unicorn_http.rl"
|
1036
1062
|
{
|
1037
1063
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
1038
1064
|
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
1039
1065
|
}
|
1040
1066
|
goto st18;
|
1041
1067
|
tr113:
|
1042
|
-
#line
|
1068
|
+
#line 345 "unicorn_http.rl"
|
1043
1069
|
{
|
1044
1070
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
1045
1071
|
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
1046
1072
|
}
|
1047
1073
|
goto st18;
|
1048
1074
|
tr118:
|
1049
|
-
#line
|
1075
|
+
#line 355 "unicorn_http.rl"
|
1050
1076
|
{
|
1051
1077
|
VALUE val;
|
1052
1078
|
|
@@ -1057,7 +1083,7 @@ tr118:
|
|
1057
1083
|
if (!STR_CSTR_EQ(val, "*"))
|
1058
1084
|
rb_hash_aset(hp->env, g_path_info, val);
|
1059
1085
|
}
|
1060
|
-
#line
|
1086
|
+
#line 330 "unicorn_http.rl"
|
1061
1087
|
{
|
1062
1088
|
VALUE str;
|
1063
1089
|
|
@@ -1075,14 +1101,14 @@ tr118:
|
|
1075
1101
|
}
|
1076
1102
|
goto st18;
|
1077
1103
|
tr125:
|
1078
|
-
#line
|
1104
|
+
#line 349 "unicorn_http.rl"
|
1079
1105
|
{MARK(start.query, p); }
|
1080
|
-
#line
|
1106
|
+
#line 350 "unicorn_http.rl"
|
1081
1107
|
{
|
1082
1108
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
1083
1109
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
1084
1110
|
}
|
1085
|
-
#line
|
1111
|
+
#line 330 "unicorn_http.rl"
|
1086
1112
|
{
|
1087
1113
|
VALUE str;
|
1088
1114
|
|
@@ -1100,12 +1126,12 @@ tr125:
|
|
1100
1126
|
}
|
1101
1127
|
goto st18;
|
1102
1128
|
tr130:
|
1103
|
-
#line
|
1129
|
+
#line 350 "unicorn_http.rl"
|
1104
1130
|
{
|
1105
1131
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
1106
1132
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
1107
1133
|
}
|
1108
|
-
#line
|
1134
|
+
#line 330 "unicorn_http.rl"
|
1109
1135
|
{
|
1110
1136
|
VALUE str;
|
1111
1137
|
|
@@ -1126,25 +1152,25 @@ st18:
|
|
1126
1152
|
if ( ++p == pe )
|
1127
1153
|
goto _test_eof18;
|
1128
1154
|
case 18:
|
1129
|
-
#line
|
1155
|
+
#line 1156 "unicorn_http.c"
|
1130
1156
|
if ( (*p) == 10 )
|
1131
1157
|
goto tr21;
|
1132
1158
|
goto st0;
|
1133
1159
|
tr23:
|
1134
|
-
#line
|
1160
|
+
#line 318 "unicorn_http.rl"
|
1135
1161
|
{ MARK(start.field, p); }
|
1136
|
-
#line
|
1162
|
+
#line 319 "unicorn_http.rl"
|
1137
1163
|
{ snake_upcase_char(deconst(p)); }
|
1138
1164
|
goto st19;
|
1139
1165
|
tr32:
|
1140
|
-
#line
|
1166
|
+
#line 319 "unicorn_http.rl"
|
1141
1167
|
{ snake_upcase_char(deconst(p)); }
|
1142
1168
|
goto st19;
|
1143
1169
|
st19:
|
1144
1170
|
if ( ++p == pe )
|
1145
1171
|
goto _test_eof19;
|
1146
1172
|
case 19:
|
1147
|
-
#line
|
1173
|
+
#line 1174 "unicorn_http.c"
|
1148
1174
|
switch( (*p) ) {
|
1149
1175
|
case 33: goto tr32;
|
1150
1176
|
case 58: goto tr33;
|
@@ -1170,18 +1196,18 @@ case 19:
|
|
1170
1196
|
goto tr32;
|
1171
1197
|
goto st0;
|
1172
1198
|
tr35:
|
1173
|
-
#line
|
1199
|
+
#line 322 "unicorn_http.rl"
|
1174
1200
|
{ MARK(mark, p); }
|
1175
1201
|
goto st20;
|
1176
1202
|
tr33:
|
1177
|
-
#line
|
1203
|
+
#line 321 "unicorn_http.rl"
|
1178
1204
|
{ hp->s.field_len = LEN(start.field, p); }
|
1179
1205
|
goto st20;
|
1180
1206
|
st20:
|
1181
1207
|
if ( ++p == pe )
|
1182
1208
|
goto _test_eof20;
|
1183
1209
|
case 20:
|
1184
|
-
#line
|
1210
|
+
#line 1211 "unicorn_http.c"
|
1185
1211
|
switch( (*p) ) {
|
1186
1212
|
case 9: goto tr35;
|
1187
1213
|
case 10: goto tr36;
|
@@ -1193,14 +1219,14 @@ case 20:
|
|
1193
1219
|
goto st0;
|
1194
1220
|
goto tr34;
|
1195
1221
|
tr34:
|
1196
|
-
#line
|
1222
|
+
#line 322 "unicorn_http.rl"
|
1197
1223
|
{ MARK(mark, p); }
|
1198
1224
|
goto st21;
|
1199
1225
|
st21:
|
1200
1226
|
if ( ++p == pe )
|
1201
1227
|
goto _test_eof21;
|
1202
1228
|
case 21:
|
1203
|
-
#line
|
1229
|
+
#line 1230 "unicorn_http.c"
|
1204
1230
|
switch( (*p) ) {
|
1205
1231
|
case 10: goto tr39;
|
1206
1232
|
case 13: goto tr40;
|
@@ -1213,7 +1239,7 @@ case 21:
|
|
1213
1239
|
goto st0;
|
1214
1240
|
goto st21;
|
1215
1241
|
tr9:
|
1216
|
-
#line
|
1242
|
+
#line 330 "unicorn_http.rl"
|
1217
1243
|
{
|
1218
1244
|
VALUE str;
|
1219
1245
|
|
@@ -1231,7 +1257,7 @@ tr9:
|
|
1231
1257
|
}
|
1232
1258
|
goto st22;
|
1233
1259
|
tr50:
|
1234
|
-
#line
|
1260
|
+
#line 355 "unicorn_http.rl"
|
1235
1261
|
{
|
1236
1262
|
VALUE val;
|
1237
1263
|
|
@@ -1242,7 +1268,7 @@ tr50:
|
|
1242
1268
|
if (!STR_CSTR_EQ(val, "*"))
|
1243
1269
|
rb_hash_aset(hp->env, g_path_info, val);
|
1244
1270
|
}
|
1245
|
-
#line
|
1271
|
+
#line 330 "unicorn_http.rl"
|
1246
1272
|
{
|
1247
1273
|
VALUE str;
|
1248
1274
|
|
@@ -1260,14 +1286,14 @@ tr50:
|
|
1260
1286
|
}
|
1261
1287
|
goto st22;
|
1262
1288
|
tr56:
|
1263
|
-
#line
|
1289
|
+
#line 349 "unicorn_http.rl"
|
1264
1290
|
{MARK(start.query, p); }
|
1265
|
-
#line
|
1291
|
+
#line 350 "unicorn_http.rl"
|
1266
1292
|
{
|
1267
1293
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
1268
1294
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
1269
1295
|
}
|
1270
|
-
#line
|
1296
|
+
#line 330 "unicorn_http.rl"
|
1271
1297
|
{
|
1272
1298
|
VALUE str;
|
1273
1299
|
|
@@ -1285,12 +1311,12 @@ tr56:
|
|
1285
1311
|
}
|
1286
1312
|
goto st22;
|
1287
1313
|
tr60:
|
1288
|
-
#line
|
1314
|
+
#line 350 "unicorn_http.rl"
|
1289
1315
|
{
|
1290
1316
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
1291
1317
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
1292
1318
|
}
|
1293
|
-
#line
|
1319
|
+
#line 330 "unicorn_http.rl"
|
1294
1320
|
{
|
1295
1321
|
VALUE str;
|
1296
1322
|
|
@@ -1311,7 +1337,7 @@ st22:
|
|
1311
1337
|
if ( ++p == pe )
|
1312
1338
|
goto _test_eof22;
|
1313
1339
|
case 22:
|
1314
|
-
#line
|
1340
|
+
#line 1341 "unicorn_http.c"
|
1315
1341
|
switch( (*p) ) {
|
1316
1342
|
case 32: goto tr42;
|
1317
1343
|
case 35: goto st0;
|
@@ -1322,14 +1348,14 @@ case 22:
|
|
1322
1348
|
goto st0;
|
1323
1349
|
goto tr41;
|
1324
1350
|
tr41:
|
1325
|
-
#line
|
1351
|
+
#line 316 "unicorn_http.rl"
|
1326
1352
|
{MARK(mark, p); }
|
1327
1353
|
goto st23;
|
1328
1354
|
st23:
|
1329
1355
|
if ( ++p == pe )
|
1330
1356
|
goto _test_eof23;
|
1331
1357
|
case 23:
|
1332
|
-
#line
|
1358
|
+
#line 1359 "unicorn_http.c"
|
1333
1359
|
switch( (*p) ) {
|
1334
1360
|
case 32: goto tr45;
|
1335
1361
|
case 35: goto st0;
|
@@ -1340,14 +1366,14 @@ case 23:
|
|
1340
1366
|
goto st0;
|
1341
1367
|
goto st23;
|
1342
1368
|
tr43:
|
1343
|
-
#line
|
1369
|
+
#line 316 "unicorn_http.rl"
|
1344
1370
|
{MARK(mark, p); }
|
1345
1371
|
goto st24;
|
1346
1372
|
st24:
|
1347
1373
|
if ( ++p == pe )
|
1348
1374
|
goto _test_eof24;
|
1349
1375
|
case 24:
|
1350
|
-
#line
|
1376
|
+
#line 1377 "unicorn_http.c"
|
1351
1377
|
if ( (*p) < 65 ) {
|
1352
1378
|
if ( 48 <= (*p) && (*p) <= 57 )
|
1353
1379
|
goto st25;
|
@@ -1371,20 +1397,20 @@ case 25:
|
|
1371
1397
|
goto st23;
|
1372
1398
|
goto st0;
|
1373
1399
|
tr6:
|
1374
|
-
#line
|
1400
|
+
#line 316 "unicorn_http.rl"
|
1375
1401
|
{MARK(mark, p); }
|
1376
1402
|
goto st26;
|
1377
1403
|
tr76:
|
1378
|
-
#line
|
1404
|
+
#line 329 "unicorn_http.rl"
|
1379
1405
|
{ rb_hash_aset(hp->env, g_http_host, STR_NEW(mark, p)); }
|
1380
|
-
#line
|
1406
|
+
#line 316 "unicorn_http.rl"
|
1381
1407
|
{MARK(mark, p); }
|
1382
1408
|
goto st26;
|
1383
1409
|
st26:
|
1384
1410
|
if ( ++p == pe )
|
1385
1411
|
goto _test_eof26;
|
1386
1412
|
case 26:
|
1387
|
-
#line
|
1413
|
+
#line 1414 "unicorn_http.c"
|
1388
1414
|
switch( (*p) ) {
|
1389
1415
|
case 32: goto tr49;
|
1390
1416
|
case 35: goto tr50;
|
@@ -1422,7 +1448,7 @@ case 28:
|
|
1422
1448
|
goto st26;
|
1423
1449
|
goto st0;
|
1424
1450
|
tr52:
|
1425
|
-
#line
|
1451
|
+
#line 355 "unicorn_http.rl"
|
1426
1452
|
{
|
1427
1453
|
VALUE val;
|
1428
1454
|
|
@@ -1438,7 +1464,7 @@ st29:
|
|
1438
1464
|
if ( ++p == pe )
|
1439
1465
|
goto _test_eof29;
|
1440
1466
|
case 29:
|
1441
|
-
#line
|
1467
|
+
#line 1468 "unicorn_http.c"
|
1442
1468
|
switch( (*p) ) {
|
1443
1469
|
case 32: goto tr55;
|
1444
1470
|
case 35: goto tr56;
|
@@ -1449,14 +1475,14 @@ case 29:
|
|
1449
1475
|
goto st0;
|
1450
1476
|
goto tr54;
|
1451
1477
|
tr54:
|
1452
|
-
#line
|
1478
|
+
#line 349 "unicorn_http.rl"
|
1453
1479
|
{MARK(start.query, p); }
|
1454
1480
|
goto st30;
|
1455
1481
|
st30:
|
1456
1482
|
if ( ++p == pe )
|
1457
1483
|
goto _test_eof30;
|
1458
1484
|
case 30:
|
1459
|
-
#line
|
1485
|
+
#line 1486 "unicorn_http.c"
|
1460
1486
|
switch( (*p) ) {
|
1461
1487
|
case 32: goto tr59;
|
1462
1488
|
case 35: goto tr60;
|
@@ -1467,14 +1493,14 @@ case 30:
|
|
1467
1493
|
goto st0;
|
1468
1494
|
goto st30;
|
1469
1495
|
tr57:
|
1470
|
-
#line
|
1496
|
+
#line 349 "unicorn_http.rl"
|
1471
1497
|
{MARK(start.query, p); }
|
1472
1498
|
goto st31;
|
1473
1499
|
st31:
|
1474
1500
|
if ( ++p == pe )
|
1475
1501
|
goto _test_eof31;
|
1476
1502
|
case 31:
|
1477
|
-
#line
|
1503
|
+
#line 1504 "unicorn_http.c"
|
1478
1504
|
if ( (*p) < 65 ) {
|
1479
1505
|
if ( 48 <= (*p) && (*p) <= 57 )
|
1480
1506
|
goto st32;
|
@@ -1498,58 +1524,58 @@ case 32:
|
|
1498
1524
|
goto st30;
|
1499
1525
|
goto st0;
|
1500
1526
|
tr7:
|
1501
|
-
#line
|
1527
|
+
#line 316 "unicorn_http.rl"
|
1502
1528
|
{MARK(mark, p); }
|
1503
|
-
#line
|
1529
|
+
#line 320 "unicorn_http.rl"
|
1504
1530
|
{ downcase_char(deconst(p)); }
|
1505
1531
|
goto st33;
|
1506
1532
|
st33:
|
1507
1533
|
if ( ++p == pe )
|
1508
1534
|
goto _test_eof33;
|
1509
1535
|
case 33:
|
1510
|
-
#line
|
1536
|
+
#line 1537 "unicorn_http.c"
|
1511
1537
|
switch( (*p) ) {
|
1512
1538
|
case 84: goto tr63;
|
1513
1539
|
case 116: goto tr63;
|
1514
1540
|
}
|
1515
1541
|
goto st0;
|
1516
1542
|
tr63:
|
1517
|
-
#line
|
1543
|
+
#line 320 "unicorn_http.rl"
|
1518
1544
|
{ downcase_char(deconst(p)); }
|
1519
1545
|
goto st34;
|
1520
1546
|
st34:
|
1521
1547
|
if ( ++p == pe )
|
1522
1548
|
goto _test_eof34;
|
1523
1549
|
case 34:
|
1524
|
-
#line
|
1550
|
+
#line 1551 "unicorn_http.c"
|
1525
1551
|
switch( (*p) ) {
|
1526
1552
|
case 84: goto tr64;
|
1527
1553
|
case 116: goto tr64;
|
1528
1554
|
}
|
1529
1555
|
goto st0;
|
1530
1556
|
tr64:
|
1531
|
-
#line
|
1557
|
+
#line 320 "unicorn_http.rl"
|
1532
1558
|
{ downcase_char(deconst(p)); }
|
1533
1559
|
goto st35;
|
1534
1560
|
st35:
|
1535
1561
|
if ( ++p == pe )
|
1536
1562
|
goto _test_eof35;
|
1537
1563
|
case 35:
|
1538
|
-
#line
|
1564
|
+
#line 1565 "unicorn_http.c"
|
1539
1565
|
switch( (*p) ) {
|
1540
1566
|
case 80: goto tr65;
|
1541
1567
|
case 112: goto tr65;
|
1542
1568
|
}
|
1543
1569
|
goto st0;
|
1544
1570
|
tr65:
|
1545
|
-
#line
|
1571
|
+
#line 320 "unicorn_http.rl"
|
1546
1572
|
{ downcase_char(deconst(p)); }
|
1547
1573
|
goto st36;
|
1548
1574
|
st36:
|
1549
1575
|
if ( ++p == pe )
|
1550
1576
|
goto _test_eof36;
|
1551
1577
|
case 36:
|
1552
|
-
#line
|
1578
|
+
#line 1579 "unicorn_http.c"
|
1553
1579
|
switch( (*p) ) {
|
1554
1580
|
case 58: goto tr66;
|
1555
1581
|
case 83: goto tr67;
|
@@ -1557,7 +1583,7 @@ case 36:
|
|
1557
1583
|
}
|
1558
1584
|
goto st0;
|
1559
1585
|
tr66:
|
1560
|
-
#line
|
1586
|
+
#line 326 "unicorn_http.rl"
|
1561
1587
|
{
|
1562
1588
|
rb_hash_aset(hp->env, g_rack_url_scheme, STR_NEW(mark, p));
|
1563
1589
|
}
|
@@ -1566,7 +1592,7 @@ st37:
|
|
1566
1592
|
if ( ++p == pe )
|
1567
1593
|
goto _test_eof37;
|
1568
1594
|
case 37:
|
1569
|
-
#line
|
1595
|
+
#line 1596 "unicorn_http.c"
|
1570
1596
|
if ( (*p) == 47 )
|
1571
1597
|
goto st38;
|
1572
1598
|
goto st0;
|
@@ -1654,14 +1680,14 @@ case 42:
|
|
1654
1680
|
goto st40;
|
1655
1681
|
goto st0;
|
1656
1682
|
tr72:
|
1657
|
-
#line
|
1683
|
+
#line 316 "unicorn_http.rl"
|
1658
1684
|
{MARK(mark, p); }
|
1659
1685
|
goto st43;
|
1660
1686
|
st43:
|
1661
1687
|
if ( ++p == pe )
|
1662
1688
|
goto _test_eof43;
|
1663
1689
|
case 43:
|
1664
|
-
#line
|
1690
|
+
#line 1691 "unicorn_http.c"
|
1665
1691
|
switch( (*p) ) {
|
1666
1692
|
case 37: goto st41;
|
1667
1693
|
case 47: goto tr76;
|
@@ -1713,14 +1739,14 @@ case 44:
|
|
1713
1739
|
goto st0;
|
1714
1740
|
goto st40;
|
1715
1741
|
tr73:
|
1716
|
-
#line
|
1742
|
+
#line 316 "unicorn_http.rl"
|
1717
1743
|
{MARK(mark, p); }
|
1718
1744
|
goto st45;
|
1719
1745
|
st45:
|
1720
1746
|
if ( ++p == pe )
|
1721
1747
|
goto _test_eof45;
|
1722
1748
|
case 45:
|
1723
|
-
#line
|
1749
|
+
#line 1750 "unicorn_http.c"
|
1724
1750
|
switch( (*p) ) {
|
1725
1751
|
case 37: goto st41;
|
1726
1752
|
case 47: goto st0;
|
@@ -1798,14 +1824,14 @@ case 47:
|
|
1798
1824
|
goto st0;
|
1799
1825
|
goto st40;
|
1800
1826
|
tr67:
|
1801
|
-
#line
|
1827
|
+
#line 320 "unicorn_http.rl"
|
1802
1828
|
{ downcase_char(deconst(p)); }
|
1803
1829
|
goto st48;
|
1804
1830
|
st48:
|
1805
1831
|
if ( ++p == pe )
|
1806
1832
|
goto _test_eof48;
|
1807
1833
|
case 48:
|
1808
|
-
#line
|
1834
|
+
#line 1835 "unicorn_http.c"
|
1809
1835
|
if ( (*p) == 58 )
|
1810
1836
|
goto tr66;
|
1811
1837
|
goto st0;
|
@@ -2321,14 +2347,14 @@ case 67:
|
|
2321
2347
|
goto tr3;
|
2322
2348
|
goto st0;
|
2323
2349
|
tr2:
|
2324
|
-
#line
|
2350
|
+
#line 316 "unicorn_http.rl"
|
2325
2351
|
{MARK(mark, p); }
|
2326
2352
|
goto st68;
|
2327
2353
|
st68:
|
2328
2354
|
if ( ++p == pe )
|
2329
2355
|
goto _test_eof68;
|
2330
2356
|
case 68:
|
2331
|
-
#line
|
2357
|
+
#line 2358 "unicorn_http.c"
|
2332
2358
|
switch( (*p) ) {
|
2333
2359
|
case 32: goto tr3;
|
2334
2360
|
case 33: goto st49;
|
@@ -2412,14 +2438,14 @@ case 70:
|
|
2412
2438
|
goto st51;
|
2413
2439
|
goto st0;
|
2414
2440
|
tr100:
|
2415
|
-
#line
|
2441
|
+
#line 325 "unicorn_http.rl"
|
2416
2442
|
{ request_method(hp, PTR_TO(mark), LEN(mark, p)); }
|
2417
2443
|
goto st71;
|
2418
2444
|
st71:
|
2419
2445
|
if ( ++p == pe )
|
2420
2446
|
goto _test_eof71;
|
2421
2447
|
case 71:
|
2422
|
-
#line
|
2448
|
+
#line 2449 "unicorn_http.c"
|
2423
2449
|
switch( (*p) ) {
|
2424
2450
|
case 42: goto tr101;
|
2425
2451
|
case 47: goto tr102;
|
@@ -2428,14 +2454,14 @@ case 71:
|
|
2428
2454
|
}
|
2429
2455
|
goto st0;
|
2430
2456
|
tr101:
|
2431
|
-
#line
|
2457
|
+
#line 316 "unicorn_http.rl"
|
2432
2458
|
{MARK(mark, p); }
|
2433
2459
|
goto st72;
|
2434
2460
|
st72:
|
2435
2461
|
if ( ++p == pe )
|
2436
2462
|
goto _test_eof72;
|
2437
2463
|
case 72:
|
2438
|
-
#line
|
2464
|
+
#line 2465 "unicorn_http.c"
|
2439
2465
|
switch( (*p) ) {
|
2440
2466
|
case 10: goto tr104;
|
2441
2467
|
case 13: goto tr105;
|
@@ -2444,7 +2470,7 @@ case 72:
|
|
2444
2470
|
}
|
2445
2471
|
goto st0;
|
2446
2472
|
tr106:
|
2447
|
-
#line
|
2473
|
+
#line 330 "unicorn_http.rl"
|
2448
2474
|
{
|
2449
2475
|
VALUE str;
|
2450
2476
|
|
@@ -2462,7 +2488,7 @@ tr106:
|
|
2462
2488
|
}
|
2463
2489
|
goto st73;
|
2464
2490
|
tr119:
|
2465
|
-
#line
|
2491
|
+
#line 355 "unicorn_http.rl"
|
2466
2492
|
{
|
2467
2493
|
VALUE val;
|
2468
2494
|
|
@@ -2473,7 +2499,7 @@ tr119:
|
|
2473
2499
|
if (!STR_CSTR_EQ(val, "*"))
|
2474
2500
|
rb_hash_aset(hp->env, g_path_info, val);
|
2475
2501
|
}
|
2476
|
-
#line
|
2502
|
+
#line 330 "unicorn_http.rl"
|
2477
2503
|
{
|
2478
2504
|
VALUE str;
|
2479
2505
|
|
@@ -2491,14 +2517,14 @@ tr119:
|
|
2491
2517
|
}
|
2492
2518
|
goto st73;
|
2493
2519
|
tr126:
|
2494
|
-
#line
|
2520
|
+
#line 349 "unicorn_http.rl"
|
2495
2521
|
{MARK(start.query, p); }
|
2496
|
-
#line
|
2522
|
+
#line 350 "unicorn_http.rl"
|
2497
2523
|
{
|
2498
2524
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
2499
2525
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
2500
2526
|
}
|
2501
|
-
#line
|
2527
|
+
#line 330 "unicorn_http.rl"
|
2502
2528
|
{
|
2503
2529
|
VALUE str;
|
2504
2530
|
|
@@ -2516,12 +2542,12 @@ tr126:
|
|
2516
2542
|
}
|
2517
2543
|
goto st73;
|
2518
2544
|
tr131:
|
2519
|
-
#line
|
2545
|
+
#line 350 "unicorn_http.rl"
|
2520
2546
|
{
|
2521
2547
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
2522
2548
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
2523
2549
|
}
|
2524
|
-
#line
|
2550
|
+
#line 330 "unicorn_http.rl"
|
2525
2551
|
{
|
2526
2552
|
VALUE str;
|
2527
2553
|
|
@@ -2542,7 +2568,7 @@ st73:
|
|
2542
2568
|
if ( ++p == pe )
|
2543
2569
|
goto _test_eof73;
|
2544
2570
|
case 73:
|
2545
|
-
#line
|
2571
|
+
#line 2572 "unicorn_http.c"
|
2546
2572
|
switch( (*p) ) {
|
2547
2573
|
case 10: goto tr108;
|
2548
2574
|
case 13: goto tr109;
|
@@ -2555,14 +2581,14 @@ case 73:
|
|
2555
2581
|
goto st0;
|
2556
2582
|
goto tr107;
|
2557
2583
|
tr107:
|
2558
|
-
#line
|
2584
|
+
#line 316 "unicorn_http.rl"
|
2559
2585
|
{MARK(mark, p); }
|
2560
2586
|
goto st74;
|
2561
2587
|
st74:
|
2562
2588
|
if ( ++p == pe )
|
2563
2589
|
goto _test_eof74;
|
2564
2590
|
case 74:
|
2565
|
-
#line
|
2591
|
+
#line 2592 "unicorn_http.c"
|
2566
2592
|
switch( (*p) ) {
|
2567
2593
|
case 10: goto tr112;
|
2568
2594
|
case 13: goto tr113;
|
@@ -2575,14 +2601,14 @@ case 74:
|
|
2575
2601
|
goto st0;
|
2576
2602
|
goto st74;
|
2577
2603
|
tr110:
|
2578
|
-
#line
|
2604
|
+
#line 316 "unicorn_http.rl"
|
2579
2605
|
{MARK(mark, p); }
|
2580
2606
|
goto st75;
|
2581
2607
|
st75:
|
2582
2608
|
if ( ++p == pe )
|
2583
2609
|
goto _test_eof75;
|
2584
2610
|
case 75:
|
2585
|
-
#line
|
2611
|
+
#line 2612 "unicorn_http.c"
|
2586
2612
|
if ( (*p) < 65 ) {
|
2587
2613
|
if ( 48 <= (*p) && (*p) <= 57 )
|
2588
2614
|
goto st76;
|
@@ -2606,20 +2632,20 @@ case 76:
|
|
2606
2632
|
goto st74;
|
2607
2633
|
goto st0;
|
2608
2634
|
tr102:
|
2609
|
-
#line
|
2635
|
+
#line 316 "unicorn_http.rl"
|
2610
2636
|
{MARK(mark, p); }
|
2611
2637
|
goto st77;
|
2612
2638
|
tr147:
|
2613
|
-
#line
|
2639
|
+
#line 329 "unicorn_http.rl"
|
2614
2640
|
{ rb_hash_aset(hp->env, g_http_host, STR_NEW(mark, p)); }
|
2615
|
-
#line
|
2641
|
+
#line 316 "unicorn_http.rl"
|
2616
2642
|
{MARK(mark, p); }
|
2617
2643
|
goto st77;
|
2618
2644
|
st77:
|
2619
2645
|
if ( ++p == pe )
|
2620
2646
|
goto _test_eof77;
|
2621
2647
|
case 77:
|
2622
|
-
#line
|
2648
|
+
#line 2649 "unicorn_http.c"
|
2623
2649
|
switch( (*p) ) {
|
2624
2650
|
case 10: goto tr117;
|
2625
2651
|
case 13: goto tr118;
|
@@ -2659,7 +2685,7 @@ case 79:
|
|
2659
2685
|
goto st77;
|
2660
2686
|
goto st0;
|
2661
2687
|
tr121:
|
2662
|
-
#line
|
2688
|
+
#line 355 "unicorn_http.rl"
|
2663
2689
|
{
|
2664
2690
|
VALUE val;
|
2665
2691
|
|
@@ -2675,7 +2701,7 @@ st80:
|
|
2675
2701
|
if ( ++p == pe )
|
2676
2702
|
goto _test_eof80;
|
2677
2703
|
case 80:
|
2678
|
-
#line
|
2704
|
+
#line 2705 "unicorn_http.c"
|
2679
2705
|
switch( (*p) ) {
|
2680
2706
|
case 10: goto tr124;
|
2681
2707
|
case 13: goto tr125;
|
@@ -2688,14 +2714,14 @@ case 80:
|
|
2688
2714
|
goto st0;
|
2689
2715
|
goto tr123;
|
2690
2716
|
tr123:
|
2691
|
-
#line
|
2717
|
+
#line 349 "unicorn_http.rl"
|
2692
2718
|
{MARK(start.query, p); }
|
2693
2719
|
goto st81;
|
2694
2720
|
st81:
|
2695
2721
|
if ( ++p == pe )
|
2696
2722
|
goto _test_eof81;
|
2697
2723
|
case 81:
|
2698
|
-
#line
|
2724
|
+
#line 2725 "unicorn_http.c"
|
2699
2725
|
switch( (*p) ) {
|
2700
2726
|
case 10: goto tr129;
|
2701
2727
|
case 13: goto tr130;
|
@@ -2708,14 +2734,14 @@ case 81:
|
|
2708
2734
|
goto st0;
|
2709
2735
|
goto st81;
|
2710
2736
|
tr127:
|
2711
|
-
#line
|
2737
|
+
#line 349 "unicorn_http.rl"
|
2712
2738
|
{MARK(start.query, p); }
|
2713
2739
|
goto st82;
|
2714
2740
|
st82:
|
2715
2741
|
if ( ++p == pe )
|
2716
2742
|
goto _test_eof82;
|
2717
2743
|
case 82:
|
2718
|
-
#line
|
2744
|
+
#line 2745 "unicorn_http.c"
|
2719
2745
|
if ( (*p) < 65 ) {
|
2720
2746
|
if ( 48 <= (*p) && (*p) <= 57 )
|
2721
2747
|
goto st83;
|
@@ -2739,58 +2765,58 @@ case 83:
|
|
2739
2765
|
goto st81;
|
2740
2766
|
goto st0;
|
2741
2767
|
tr103:
|
2742
|
-
#line
|
2768
|
+
#line 316 "unicorn_http.rl"
|
2743
2769
|
{MARK(mark, p); }
|
2744
|
-
#line
|
2770
|
+
#line 320 "unicorn_http.rl"
|
2745
2771
|
{ downcase_char(deconst(p)); }
|
2746
2772
|
goto st84;
|
2747
2773
|
st84:
|
2748
2774
|
if ( ++p == pe )
|
2749
2775
|
goto _test_eof84;
|
2750
2776
|
case 84:
|
2751
|
-
#line
|
2777
|
+
#line 2778 "unicorn_http.c"
|
2752
2778
|
switch( (*p) ) {
|
2753
2779
|
case 84: goto tr134;
|
2754
2780
|
case 116: goto tr134;
|
2755
2781
|
}
|
2756
2782
|
goto st0;
|
2757
2783
|
tr134:
|
2758
|
-
#line
|
2784
|
+
#line 320 "unicorn_http.rl"
|
2759
2785
|
{ downcase_char(deconst(p)); }
|
2760
2786
|
goto st85;
|
2761
2787
|
st85:
|
2762
2788
|
if ( ++p == pe )
|
2763
2789
|
goto _test_eof85;
|
2764
2790
|
case 85:
|
2765
|
-
#line
|
2791
|
+
#line 2792 "unicorn_http.c"
|
2766
2792
|
switch( (*p) ) {
|
2767
2793
|
case 84: goto tr135;
|
2768
2794
|
case 116: goto tr135;
|
2769
2795
|
}
|
2770
2796
|
goto st0;
|
2771
2797
|
tr135:
|
2772
|
-
#line
|
2798
|
+
#line 320 "unicorn_http.rl"
|
2773
2799
|
{ downcase_char(deconst(p)); }
|
2774
2800
|
goto st86;
|
2775
2801
|
st86:
|
2776
2802
|
if ( ++p == pe )
|
2777
2803
|
goto _test_eof86;
|
2778
2804
|
case 86:
|
2779
|
-
#line
|
2805
|
+
#line 2806 "unicorn_http.c"
|
2780
2806
|
switch( (*p) ) {
|
2781
2807
|
case 80: goto tr136;
|
2782
2808
|
case 112: goto tr136;
|
2783
2809
|
}
|
2784
2810
|
goto st0;
|
2785
2811
|
tr136:
|
2786
|
-
#line
|
2812
|
+
#line 320 "unicorn_http.rl"
|
2787
2813
|
{ downcase_char(deconst(p)); }
|
2788
2814
|
goto st87;
|
2789
2815
|
st87:
|
2790
2816
|
if ( ++p == pe )
|
2791
2817
|
goto _test_eof87;
|
2792
2818
|
case 87:
|
2793
|
-
#line
|
2819
|
+
#line 2820 "unicorn_http.c"
|
2794
2820
|
switch( (*p) ) {
|
2795
2821
|
case 58: goto tr137;
|
2796
2822
|
case 83: goto tr138;
|
@@ -2798,7 +2824,7 @@ case 87:
|
|
2798
2824
|
}
|
2799
2825
|
goto st0;
|
2800
2826
|
tr137:
|
2801
|
-
#line
|
2827
|
+
#line 326 "unicorn_http.rl"
|
2802
2828
|
{
|
2803
2829
|
rb_hash_aset(hp->env, g_rack_url_scheme, STR_NEW(mark, p));
|
2804
2830
|
}
|
@@ -2807,7 +2833,7 @@ st88:
|
|
2807
2833
|
if ( ++p == pe )
|
2808
2834
|
goto _test_eof88;
|
2809
2835
|
case 88:
|
2810
|
-
#line
|
2836
|
+
#line 2837 "unicorn_http.c"
|
2811
2837
|
if ( (*p) == 47 )
|
2812
2838
|
goto st89;
|
2813
2839
|
goto st0;
|
@@ -2895,14 +2921,14 @@ case 93:
|
|
2895
2921
|
goto st91;
|
2896
2922
|
goto st0;
|
2897
2923
|
tr143:
|
2898
|
-
#line
|
2924
|
+
#line 316 "unicorn_http.rl"
|
2899
2925
|
{MARK(mark, p); }
|
2900
2926
|
goto st94;
|
2901
2927
|
st94:
|
2902
2928
|
if ( ++p == pe )
|
2903
2929
|
goto _test_eof94;
|
2904
2930
|
case 94:
|
2905
|
-
#line
|
2931
|
+
#line 2932 "unicorn_http.c"
|
2906
2932
|
switch( (*p) ) {
|
2907
2933
|
case 37: goto st92;
|
2908
2934
|
case 47: goto tr147;
|
@@ -2954,14 +2980,14 @@ case 95:
|
|
2954
2980
|
goto st0;
|
2955
2981
|
goto st91;
|
2956
2982
|
tr144:
|
2957
|
-
#line
|
2983
|
+
#line 316 "unicorn_http.rl"
|
2958
2984
|
{MARK(mark, p); }
|
2959
2985
|
goto st96;
|
2960
2986
|
st96:
|
2961
2987
|
if ( ++p == pe )
|
2962
2988
|
goto _test_eof96;
|
2963
2989
|
case 96:
|
2964
|
-
#line
|
2990
|
+
#line 2991 "unicorn_http.c"
|
2965
2991
|
switch( (*p) ) {
|
2966
2992
|
case 37: goto st92;
|
2967
2993
|
case 47: goto st0;
|
@@ -3039,14 +3065,14 @@ case 98:
|
|
3039
3065
|
goto st0;
|
3040
3066
|
goto st91;
|
3041
3067
|
tr138:
|
3042
|
-
#line
|
3068
|
+
#line 320 "unicorn_http.rl"
|
3043
3069
|
{ downcase_char(deconst(p)); }
|
3044
3070
|
goto st99;
|
3045
3071
|
st99:
|
3046
3072
|
if ( ++p == pe )
|
3047
3073
|
goto _test_eof99;
|
3048
3074
|
case 99:
|
3049
|
-
#line
|
3075
|
+
#line 3076 "unicorn_http.c"
|
3050
3076
|
if ( (*p) == 58 )
|
3051
3077
|
goto tr137;
|
3052
3078
|
goto st0;
|
@@ -3066,7 +3092,7 @@ case 100:
|
|
3066
3092
|
goto tr152;
|
3067
3093
|
goto st0;
|
3068
3094
|
tr151:
|
3069
|
-
#line
|
3095
|
+
#line 365 "unicorn_http.rl"
|
3070
3096
|
{
|
3071
3097
|
hp->len.chunk = step_incr(hp->len.chunk, (*p), 16);
|
3072
3098
|
if (hp->len.chunk < 0)
|
@@ -3077,7 +3103,7 @@ st101:
|
|
3077
3103
|
if ( ++p == pe )
|
3078
3104
|
goto _test_eof101;
|
3079
3105
|
case 101:
|
3080
|
-
#line
|
3106
|
+
#line 3107 "unicorn_http.c"
|
3081
3107
|
switch( (*p) ) {
|
3082
3108
|
case 10: goto tr153;
|
3083
3109
|
case 13: goto st102;
|
@@ -3094,7 +3120,7 @@ case 101:
|
|
3094
3120
|
goto tr152;
|
3095
3121
|
goto st0;
|
3096
3122
|
tr153:
|
3097
|
-
#line
|
3123
|
+
#line 394 "unicorn_http.rl"
|
3098
3124
|
{
|
3099
3125
|
HP_FL_SET(hp, INTRAILER);
|
3100
3126
|
cs = http_parser_en_Trailers;
|
@@ -3107,7 +3133,7 @@ st123:
|
|
3107
3133
|
if ( ++p == pe )
|
3108
3134
|
goto _test_eof123;
|
3109
3135
|
case 123:
|
3110
|
-
#line
|
3136
|
+
#line 3137 "unicorn_http.c"
|
3111
3137
|
goto st0;
|
3112
3138
|
st102:
|
3113
3139
|
if ( ++p == pe )
|
@@ -3117,7 +3143,7 @@ case 102:
|
|
3117
3143
|
goto tr153;
|
3118
3144
|
goto st0;
|
3119
3145
|
tr152:
|
3120
|
-
#line
|
3146
|
+
#line 365 "unicorn_http.rl"
|
3121
3147
|
{
|
3122
3148
|
hp->len.chunk = step_incr(hp->len.chunk, (*p), 16);
|
3123
3149
|
if (hp->len.chunk < 0)
|
@@ -3128,7 +3154,7 @@ st103:
|
|
3128
3154
|
if ( ++p == pe )
|
3129
3155
|
goto _test_eof103;
|
3130
3156
|
case 103:
|
3131
|
-
#line
|
3157
|
+
#line 3158 "unicorn_http.c"
|
3132
3158
|
switch( (*p) ) {
|
3133
3159
|
case 10: goto st104;
|
3134
3160
|
case 13: goto st107;
|
@@ -3149,7 +3175,7 @@ st104:
|
|
3149
3175
|
case 104:
|
3150
3176
|
goto tr159;
|
3151
3177
|
tr159:
|
3152
|
-
#line
|
3178
|
+
#line 402 "unicorn_http.rl"
|
3153
3179
|
{
|
3154
3180
|
skip_chunk_data_hack: {
|
3155
3181
|
size_t nr = MIN((size_t)hp->len.chunk, REMAINING);
|
@@ -3171,7 +3197,7 @@ st105:
|
|
3171
3197
|
if ( ++p == pe )
|
3172
3198
|
goto _test_eof105;
|
3173
3199
|
case 105:
|
3174
|
-
#line
|
3200
|
+
#line 3201 "unicorn_http.c"
|
3175
3201
|
switch( (*p) ) {
|
3176
3202
|
case 10: goto st100;
|
3177
3203
|
case 13: goto st106;
|
@@ -3378,30 +3404,30 @@ case 113:
|
|
3378
3404
|
goto st113;
|
3379
3405
|
goto st0;
|
3380
3406
|
tr172:
|
3381
|
-
#line
|
3407
|
+
#line 322 "unicorn_http.rl"
|
3382
3408
|
{ MARK(mark, p); }
|
3383
|
-
#line
|
3409
|
+
#line 324 "unicorn_http.rl"
|
3384
3410
|
{ write_cont_value(hp, buffer, p); }
|
3385
3411
|
goto st114;
|
3386
3412
|
tr175:
|
3387
|
-
#line
|
3413
|
+
#line 324 "unicorn_http.rl"
|
3388
3414
|
{ write_cont_value(hp, buffer, p); }
|
3389
3415
|
goto st114;
|
3390
3416
|
tr182:
|
3391
|
-
#line
|
3417
|
+
#line 322 "unicorn_http.rl"
|
3392
3418
|
{ MARK(mark, p); }
|
3393
|
-
#line
|
3419
|
+
#line 323 "unicorn_http.rl"
|
3394
3420
|
{ write_value(hp, buffer, p); }
|
3395
3421
|
goto st114;
|
3396
3422
|
tr185:
|
3397
|
-
#line
|
3423
|
+
#line 323 "unicorn_http.rl"
|
3398
3424
|
{ write_value(hp, buffer, p); }
|
3399
3425
|
goto st114;
|
3400
3426
|
st114:
|
3401
3427
|
if ( ++p == pe )
|
3402
3428
|
goto _test_eof114;
|
3403
3429
|
case 114:
|
3404
|
-
#line
|
3430
|
+
#line 3431 "unicorn_http.c"
|
3405
3431
|
switch( (*p) ) {
|
3406
3432
|
case 9: goto st115;
|
3407
3433
|
case 10: goto tr167;
|
@@ -3430,14 +3456,14 @@ case 114:
|
|
3430
3456
|
goto tr169;
|
3431
3457
|
goto st0;
|
3432
3458
|
tr171:
|
3433
|
-
#line
|
3459
|
+
#line 322 "unicorn_http.rl"
|
3434
3460
|
{ MARK(mark, p); }
|
3435
3461
|
goto st115;
|
3436
3462
|
st115:
|
3437
3463
|
if ( ++p == pe )
|
3438
3464
|
goto _test_eof115;
|
3439
3465
|
case 115:
|
3440
|
-
#line
|
3466
|
+
#line 3467 "unicorn_http.c"
|
3441
3467
|
switch( (*p) ) {
|
3442
3468
|
case 9: goto tr171;
|
3443
3469
|
case 10: goto tr172;
|
@@ -3449,14 +3475,14 @@ case 115:
|
|
3449
3475
|
goto st0;
|
3450
3476
|
goto tr170;
|
3451
3477
|
tr170:
|
3452
|
-
#line
|
3478
|
+
#line 322 "unicorn_http.rl"
|
3453
3479
|
{ MARK(mark, p); }
|
3454
3480
|
goto st116;
|
3455
3481
|
st116:
|
3456
3482
|
if ( ++p == pe )
|
3457
3483
|
goto _test_eof116;
|
3458
3484
|
case 116:
|
3459
|
-
#line
|
3485
|
+
#line 3486 "unicorn_http.c"
|
3460
3486
|
switch( (*p) ) {
|
3461
3487
|
case 10: goto tr175;
|
3462
3488
|
case 13: goto tr176;
|
@@ -3469,35 +3495,35 @@ case 116:
|
|
3469
3495
|
goto st0;
|
3470
3496
|
goto st116;
|
3471
3497
|
tr173:
|
3472
|
-
#line
|
3498
|
+
#line 322 "unicorn_http.rl"
|
3473
3499
|
{ MARK(mark, p); }
|
3474
|
-
#line
|
3500
|
+
#line 324 "unicorn_http.rl"
|
3475
3501
|
{ write_cont_value(hp, buffer, p); }
|
3476
3502
|
goto st117;
|
3477
3503
|
tr176:
|
3478
|
-
#line
|
3504
|
+
#line 324 "unicorn_http.rl"
|
3479
3505
|
{ write_cont_value(hp, buffer, p); }
|
3480
3506
|
goto st117;
|
3481
3507
|
tr183:
|
3482
|
-
#line
|
3508
|
+
#line 322 "unicorn_http.rl"
|
3483
3509
|
{ MARK(mark, p); }
|
3484
|
-
#line
|
3510
|
+
#line 323 "unicorn_http.rl"
|
3485
3511
|
{ write_value(hp, buffer, p); }
|
3486
3512
|
goto st117;
|
3487
3513
|
tr186:
|
3488
|
-
#line
|
3514
|
+
#line 323 "unicorn_http.rl"
|
3489
3515
|
{ write_value(hp, buffer, p); }
|
3490
3516
|
goto st117;
|
3491
3517
|
st117:
|
3492
3518
|
if ( ++p == pe )
|
3493
3519
|
goto _test_eof117;
|
3494
3520
|
case 117:
|
3495
|
-
#line
|
3521
|
+
#line 3522 "unicorn_http.c"
|
3496
3522
|
if ( (*p) == 10 )
|
3497
3523
|
goto st114;
|
3498
3524
|
goto st0;
|
3499
3525
|
tr167:
|
3500
|
-
#line
|
3526
|
+
#line 389 "unicorn_http.rl"
|
3501
3527
|
{
|
3502
3528
|
cs = http_parser_first_final;
|
3503
3529
|
goto post_exec;
|
@@ -3507,7 +3533,7 @@ st124:
|
|
3507
3533
|
if ( ++p == pe )
|
3508
3534
|
goto _test_eof124;
|
3509
3535
|
case 124:
|
3510
|
-
#line
|
3536
|
+
#line 3537 "unicorn_http.c"
|
3511
3537
|
goto st0;
|
3512
3538
|
st118:
|
3513
3539
|
if ( ++p == pe )
|
@@ -3517,20 +3543,20 @@ case 118:
|
|
3517
3543
|
goto tr167;
|
3518
3544
|
goto st0;
|
3519
3545
|
tr169:
|
3520
|
-
#line
|
3546
|
+
#line 318 "unicorn_http.rl"
|
3521
3547
|
{ MARK(start.field, p); }
|
3522
|
-
#line
|
3548
|
+
#line 319 "unicorn_http.rl"
|
3523
3549
|
{ snake_upcase_char(deconst(p)); }
|
3524
3550
|
goto st119;
|
3525
3551
|
tr178:
|
3526
|
-
#line
|
3552
|
+
#line 319 "unicorn_http.rl"
|
3527
3553
|
{ snake_upcase_char(deconst(p)); }
|
3528
3554
|
goto st119;
|
3529
3555
|
st119:
|
3530
3556
|
if ( ++p == pe )
|
3531
3557
|
goto _test_eof119;
|
3532
3558
|
case 119:
|
3533
|
-
#line
|
3559
|
+
#line 3560 "unicorn_http.c"
|
3534
3560
|
switch( (*p) ) {
|
3535
3561
|
case 33: goto tr178;
|
3536
3562
|
case 58: goto tr179;
|
@@ -3556,18 +3582,18 @@ case 119:
|
|
3556
3582
|
goto tr178;
|
3557
3583
|
goto st0;
|
3558
3584
|
tr181:
|
3559
|
-
#line
|
3585
|
+
#line 322 "unicorn_http.rl"
|
3560
3586
|
{ MARK(mark, p); }
|
3561
3587
|
goto st120;
|
3562
3588
|
tr179:
|
3563
|
-
#line
|
3589
|
+
#line 321 "unicorn_http.rl"
|
3564
3590
|
{ hp->s.field_len = LEN(start.field, p); }
|
3565
3591
|
goto st120;
|
3566
3592
|
st120:
|
3567
3593
|
if ( ++p == pe )
|
3568
3594
|
goto _test_eof120;
|
3569
3595
|
case 120:
|
3570
|
-
#line
|
3596
|
+
#line 3597 "unicorn_http.c"
|
3571
3597
|
switch( (*p) ) {
|
3572
3598
|
case 9: goto tr181;
|
3573
3599
|
case 10: goto tr182;
|
@@ -3579,14 +3605,14 @@ case 120:
|
|
3579
3605
|
goto st0;
|
3580
3606
|
goto tr180;
|
3581
3607
|
tr180:
|
3582
|
-
#line
|
3608
|
+
#line 322 "unicorn_http.rl"
|
3583
3609
|
{ MARK(mark, p); }
|
3584
3610
|
goto st121;
|
3585
3611
|
st121:
|
3586
3612
|
if ( ++p == pe )
|
3587
3613
|
goto _test_eof121;
|
3588
3614
|
case 121:
|
3589
|
-
#line
|
3615
|
+
#line 3616 "unicorn_http.c"
|
3590
3616
|
switch( (*p) ) {
|
3591
3617
|
case 10: goto tr185;
|
3592
3618
|
case 13: goto tr186;
|
@@ -3727,7 +3753,7 @@ case 121:
|
|
3727
3753
|
_out: {}
|
3728
3754
|
}
|
3729
3755
|
|
3730
|
-
#line
|
3756
|
+
#line 463 "unicorn_http.rl"
|
3731
3757
|
post_exec: /* "_out:" also goes here */
|
3732
3758
|
if (hp->cs != http_parser_error)
|
3733
3759
|
hp->cs = cs;
|
@@ -3781,7 +3807,7 @@ static void set_url_scheme(VALUE env, VALUE *server_port)
|
|
3781
3807
|
* and X-Forwarded-Proto handling from this parser? We've had it
|
3782
3808
|
* forever and nobody has said anything against it, either.
|
3783
3809
|
* Anyways, please send comments to our public mailing list:
|
3784
|
-
* unicorn-public@
|
3810
|
+
* unicorn-public@yhbt.net (no HTML mail, no subscription necessary)
|
3785
3811
|
*/
|
3786
3812
|
scheme = rb_hash_aref(env, g_http_x_forwarded_ssl);
|
3787
3813
|
if (!NIL_P(scheme) && STR_CSTR_EQ(scheme, "on")) {
|
@@ -3907,7 +3933,7 @@ static VALUE HttpParser_clear(VALUE self)
|
|
3907
3933
|
return HttpParser_init(self);
|
3908
3934
|
|
3909
3935
|
http_parser_init(hp);
|
3910
|
-
|
3936
|
+
rb_hash_clear(hp->env);
|
3911
3937
|
|
3912
3938
|
return self;
|
3913
3939
|
}
|
@@ -4225,11 +4251,8 @@ static VALUE HttpParser_rssget(VALUE self)
|
|
4225
4251
|
|
4226
4252
|
void Init_unicorn_http(void)
|
4227
4253
|
{
|
4228
|
-
|
4229
|
-
VALUE mUnicorn, cHttpParser;
|
4254
|
+
VALUE mUnicorn;
|
4230
4255
|
|
4231
|
-
mark_ary = rb_ary_new();
|
4232
|
-
rb_global_variable(&mark_ary);
|
4233
4256
|
mUnicorn = rb_define_module("Unicorn");
|
4234
4257
|
cHttpParser = rb_define_class_under(mUnicorn, "HttpParser", rb_cObject);
|
4235
4258
|
eHttpParserError =
|
@@ -4239,7 +4262,8 @@ void Init_unicorn_http(void)
|
|
4239
4262
|
e414 = rb_define_class_under(mUnicorn, "RequestURITooLongError",
|
4240
4263
|
eHttpParserError);
|
4241
4264
|
|
4242
|
-
|
4265
|
+
id_uminus = rb_intern("-@");
|
4266
|
+
init_globals();
|
4243
4267
|
rb_define_alloc_func(cHttpParser, HttpParser_alloc);
|
4244
4268
|
rb_define_method(cHttpParser, "initialize", HttpParser_init, 0);
|
4245
4269
|
rb_define_method(cHttpParser, "clear", HttpParser_clear, 0);
|
@@ -4276,19 +4300,20 @@ void Init_unicorn_http(void)
|
|
4276
4300
|
|
4277
4301
|
rb_define_singleton_method(cHttpParser, "max_header_len=", set_maxhdrlen, 1);
|
4278
4302
|
|
4279
|
-
init_common_fields(
|
4303
|
+
init_common_fields();
|
4280
4304
|
SET_GLOBAL(g_http_host, "HOST");
|
4281
4305
|
SET_GLOBAL(g_http_trailer, "TRAILER");
|
4282
4306
|
SET_GLOBAL(g_http_transfer_encoding, "TRANSFER_ENCODING");
|
4283
4307
|
SET_GLOBAL(g_content_length, "CONTENT_LENGTH");
|
4284
4308
|
SET_GLOBAL(g_http_connection, "CONNECTION");
|
4285
4309
|
id_set_backtrace = rb_intern("set_backtrace");
|
4286
|
-
init_unicorn_httpdate(
|
4287
|
-
|
4288
|
-
OBJ_FREEZE(mark_ary);
|
4310
|
+
init_unicorn_httpdate();
|
4289
4311
|
|
4290
4312
|
#ifndef HAVE_RB_HASH_CLEAR
|
4291
4313
|
id_clear = rb_intern("clear");
|
4292
4314
|
#endif
|
4315
|
+
id_is_chunked_p = rb_intern("is_chunked?");
|
4316
|
+
|
4317
|
+
init_epollexclusive(mUnicorn);
|
4293
4318
|
}
|
4294
4319
|
#undef SET_GLOBAL
|