pitchfork 0.18.1 → 0.18.2
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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +8 -6
- data/.github/workflows/release.yml +29 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +7 -1
- data/ext/pitchfork_http/pitchfork_http.c +259 -183
- data/ext/pitchfork_http/pitchfork_http.rl +9 -10
- data/lib/pitchfork/http_parser.rb +4 -0
- data/lib/pitchfork/http_server.rb +9 -6
- data/lib/pitchfork/version.rb +1 -1
- data/lib/pitchfork.rb +2 -6
- metadata +4 -6
|
@@ -325,7 +325,7 @@ static void write_value(VALUE self, struct http_parser *hp,
|
|
|
325
325
|
/** Machine **/
|
|
326
326
|
|
|
327
327
|
|
|
328
|
-
#line
|
|
328
|
+
#line 425 "pitchfork_http.rl"
|
|
329
329
|
|
|
330
330
|
|
|
331
331
|
/** Data **/
|
|
@@ -341,7 +341,7 @@ static const int http_parser_en_Trailers = 114;
|
|
|
341
341
|
static const int http_parser_en_main = 1;
|
|
342
342
|
|
|
343
343
|
|
|
344
|
-
#line
|
|
344
|
+
#line 429 "pitchfork_http.rl"
|
|
345
345
|
|
|
346
346
|
static void http_parser_init(struct http_parser *hp)
|
|
347
347
|
{
|
|
@@ -359,7 +359,7 @@ static void http_parser_init(struct http_parser *hp)
|
|
|
359
359
|
cs = http_parser_start;
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
-
#line
|
|
362
|
+
#line 441 "pitchfork_http.rl"
|
|
363
363
|
hp->cs = cs;
|
|
364
364
|
}
|
|
365
365
|
|
|
@@ -487,85 +487,97 @@ case 4:
|
|
|
487
487
|
tr8:
|
|
488
488
|
#line 342 "pitchfork_http.rl"
|
|
489
489
|
{
|
|
490
|
+
VALUE str;
|
|
491
|
+
|
|
490
492
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
491
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
493
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
494
|
+
|
|
495
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
496
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
497
|
+
}
|
|
492
498
|
}
|
|
493
499
|
goto st5;
|
|
494
500
|
tr42:
|
|
495
501
|
#line 328 "pitchfork_http.rl"
|
|
496
502
|
{MARK(mark, p); }
|
|
497
|
-
#line
|
|
503
|
+
#line 352 "pitchfork_http.rl"
|
|
498
504
|
{
|
|
499
505
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
|
500
|
-
|
|
501
|
-
if (STR_CSTR_EQ(str, "*")) {
|
|
502
|
-
VALUE str = rb_str_new("*", 1);
|
|
503
|
-
rb_hash_aset(hp->env, g_path_info, str);
|
|
504
|
-
rb_hash_aset(hp->env, g_request_path, str);
|
|
505
|
-
}
|
|
506
|
+
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
|
506
507
|
}
|
|
507
508
|
goto st5;
|
|
508
509
|
tr45:
|
|
509
|
-
#line
|
|
510
|
+
#line 352 "pitchfork_http.rl"
|
|
510
511
|
{
|
|
511
512
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
|
512
|
-
|
|
513
|
-
if (STR_CSTR_EQ(str, "*")) {
|
|
514
|
-
VALUE str = rb_str_new("*", 1);
|
|
515
|
-
rb_hash_aset(hp->env, g_path_info, str);
|
|
516
|
-
rb_hash_aset(hp->env, g_request_path, str);
|
|
517
|
-
}
|
|
513
|
+
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
|
518
514
|
}
|
|
519
515
|
goto st5;
|
|
520
516
|
tr49:
|
|
521
|
-
#line
|
|
517
|
+
#line 362 "pitchfork_http.rl"
|
|
522
518
|
{
|
|
523
519
|
VALUE val;
|
|
524
520
|
|
|
525
521
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_PATH);
|
|
526
522
|
val = rb_hash_aset(hp->env, g_request_path, STR_NEW(mark, p));
|
|
527
523
|
|
|
528
|
-
|
|
529
|
-
if (!STR_CSTR_EQ(val, "*"))
|
|
530
|
-
rb_hash_aset(hp->env, g_path_info, val);
|
|
524
|
+
rb_hash_aset(hp->env, g_path_info, val);
|
|
531
525
|
}
|
|
532
526
|
#line 342 "pitchfork_http.rl"
|
|
533
527
|
{
|
|
528
|
+
VALUE str;
|
|
529
|
+
|
|
534
530
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
535
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
531
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
532
|
+
|
|
533
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
534
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
535
|
+
}
|
|
536
536
|
}
|
|
537
537
|
goto st5;
|
|
538
538
|
tr55:
|
|
539
|
-
#line 355 "pitchfork_http.rl"
|
|
540
|
-
{MARK(start.query, p); }
|
|
541
539
|
#line 356 "pitchfork_http.rl"
|
|
540
|
+
{MARK(start.query, p); }
|
|
541
|
+
#line 357 "pitchfork_http.rl"
|
|
542
542
|
{
|
|
543
543
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
|
544
544
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
|
545
545
|
}
|
|
546
546
|
#line 342 "pitchfork_http.rl"
|
|
547
547
|
{
|
|
548
|
+
VALUE str;
|
|
549
|
+
|
|
548
550
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
549
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
551
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
552
|
+
|
|
553
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
554
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
555
|
+
}
|
|
550
556
|
}
|
|
551
557
|
goto st5;
|
|
552
558
|
tr59:
|
|
553
|
-
#line
|
|
559
|
+
#line 357 "pitchfork_http.rl"
|
|
554
560
|
{
|
|
555
561
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
|
556
562
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
|
557
563
|
}
|
|
558
564
|
#line 342 "pitchfork_http.rl"
|
|
559
565
|
{
|
|
566
|
+
VALUE str;
|
|
567
|
+
|
|
560
568
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
561
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
569
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
570
|
+
|
|
571
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
572
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
573
|
+
}
|
|
562
574
|
}
|
|
563
575
|
goto st5;
|
|
564
576
|
st5:
|
|
565
577
|
if ( ++p == pe )
|
|
566
578
|
goto _test_eof5;
|
|
567
579
|
case 5:
|
|
568
|
-
#line
|
|
580
|
+
#line 581 "pitchfork_http.c"
|
|
569
581
|
if ( (*p) == 72 )
|
|
570
582
|
goto tr10;
|
|
571
583
|
goto st0;
|
|
@@ -577,7 +589,7 @@ st6:
|
|
|
577
589
|
if ( ++p == pe )
|
|
578
590
|
goto _test_eof6;
|
|
579
591
|
case 6:
|
|
580
|
-
#line
|
|
592
|
+
#line 593 "pitchfork_http.c"
|
|
581
593
|
if ( (*p) == 84 )
|
|
582
594
|
goto st7;
|
|
583
595
|
goto st0;
|
|
@@ -637,7 +649,7 @@ case 13:
|
|
|
637
649
|
goto st13;
|
|
638
650
|
goto st0;
|
|
639
651
|
tr18:
|
|
640
|
-
#line
|
|
652
|
+
#line 361 "pitchfork_http.rl"
|
|
641
653
|
{ http_version(hp, PTR_TO(mark), LEN(mark, p)); }
|
|
642
654
|
goto st14;
|
|
643
655
|
tr26:
|
|
@@ -664,7 +676,7 @@ st14:
|
|
|
664
676
|
if ( ++p == pe )
|
|
665
677
|
goto _test_eof14;
|
|
666
678
|
case 14:
|
|
667
|
-
#line
|
|
679
|
+
#line 680 "pitchfork_http.c"
|
|
668
680
|
switch( (*p) ) {
|
|
669
681
|
case 9: goto st15;
|
|
670
682
|
case 10: goto tr21;
|
|
@@ -700,7 +712,7 @@ st15:
|
|
|
700
712
|
if ( ++p == pe )
|
|
701
713
|
goto _test_eof15;
|
|
702
714
|
case 15:
|
|
703
|
-
#line
|
|
715
|
+
#line 716 "pitchfork_http.c"
|
|
704
716
|
switch( (*p) ) {
|
|
705
717
|
case 9: goto tr25;
|
|
706
718
|
case 10: goto tr26;
|
|
@@ -719,7 +731,7 @@ st16:
|
|
|
719
731
|
if ( ++p == pe )
|
|
720
732
|
goto _test_eof16;
|
|
721
733
|
case 16:
|
|
722
|
-
#line
|
|
734
|
+
#line 735 "pitchfork_http.c"
|
|
723
735
|
switch( (*p) ) {
|
|
724
736
|
case 10: goto tr29;
|
|
725
737
|
case 13: goto tr30;
|
|
@@ -732,7 +744,7 @@ case 16:
|
|
|
732
744
|
goto st0;
|
|
733
745
|
goto st16;
|
|
734
746
|
tr19:
|
|
735
|
-
#line
|
|
747
|
+
#line 361 "pitchfork_http.rl"
|
|
736
748
|
{ http_version(hp, PTR_TO(mark), LEN(mark, p)); }
|
|
737
749
|
goto st17;
|
|
738
750
|
tr27:
|
|
@@ -759,12 +771,12 @@ st17:
|
|
|
759
771
|
if ( ++p == pe )
|
|
760
772
|
goto _test_eof17;
|
|
761
773
|
case 17:
|
|
762
|
-
#line
|
|
774
|
+
#line 775 "pitchfork_http.c"
|
|
763
775
|
if ( (*p) == 10 )
|
|
764
776
|
goto st14;
|
|
765
777
|
goto st0;
|
|
766
778
|
tr21:
|
|
767
|
-
#line
|
|
779
|
+
#line 375 "pitchfork_http.rl"
|
|
768
780
|
{
|
|
769
781
|
finalize_header(hp);
|
|
770
782
|
|
|
@@ -787,10 +799,16 @@ tr21:
|
|
|
787
799
|
tr104:
|
|
788
800
|
#line 342 "pitchfork_http.rl"
|
|
789
801
|
{
|
|
802
|
+
VALUE str;
|
|
803
|
+
|
|
790
804
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
791
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
805
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
806
|
+
|
|
807
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
808
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
809
|
+
}
|
|
792
810
|
}
|
|
793
|
-
#line
|
|
811
|
+
#line 375 "pitchfork_http.rl"
|
|
794
812
|
{
|
|
795
813
|
finalize_header(hp);
|
|
796
814
|
|
|
@@ -813,17 +831,12 @@ tr104:
|
|
|
813
831
|
tr108:
|
|
814
832
|
#line 328 "pitchfork_http.rl"
|
|
815
833
|
{MARK(mark, p); }
|
|
816
|
-
#line
|
|
834
|
+
#line 352 "pitchfork_http.rl"
|
|
817
835
|
{
|
|
818
836
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
|
819
|
-
|
|
820
|
-
if (STR_CSTR_EQ(str, "*")) {
|
|
821
|
-
VALUE str = rb_str_new("*", 1);
|
|
822
|
-
rb_hash_aset(hp->env, g_path_info, str);
|
|
823
|
-
rb_hash_aset(hp->env, g_request_path, str);
|
|
824
|
-
}
|
|
837
|
+
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
|
825
838
|
}
|
|
826
|
-
#line
|
|
839
|
+
#line 375 "pitchfork_http.rl"
|
|
827
840
|
{
|
|
828
841
|
finalize_header(hp);
|
|
829
842
|
|
|
@@ -844,17 +857,12 @@ tr108:
|
|
|
844
857
|
}
|
|
845
858
|
goto st122;
|
|
846
859
|
tr112:
|
|
847
|
-
#line
|
|
860
|
+
#line 352 "pitchfork_http.rl"
|
|
848
861
|
{
|
|
849
862
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
|
850
|
-
|
|
851
|
-
if (STR_CSTR_EQ(str, "*")) {
|
|
852
|
-
VALUE str = rb_str_new("*", 1);
|
|
853
|
-
rb_hash_aset(hp->env, g_path_info, str);
|
|
854
|
-
rb_hash_aset(hp->env, g_request_path, str);
|
|
855
|
-
}
|
|
863
|
+
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
|
856
864
|
}
|
|
857
|
-
#line
|
|
865
|
+
#line 375 "pitchfork_http.rl"
|
|
858
866
|
{
|
|
859
867
|
finalize_header(hp);
|
|
860
868
|
|
|
@@ -875,23 +883,27 @@ tr112:
|
|
|
875
883
|
}
|
|
876
884
|
goto st122;
|
|
877
885
|
tr117:
|
|
878
|
-
#line
|
|
886
|
+
#line 362 "pitchfork_http.rl"
|
|
879
887
|
{
|
|
880
888
|
VALUE val;
|
|
881
889
|
|
|
882
890
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_PATH);
|
|
883
891
|
val = rb_hash_aset(hp->env, g_request_path, STR_NEW(mark, p));
|
|
884
892
|
|
|
885
|
-
|
|
886
|
-
if (!STR_CSTR_EQ(val, "*"))
|
|
887
|
-
rb_hash_aset(hp->env, g_path_info, val);
|
|
893
|
+
rb_hash_aset(hp->env, g_path_info, val);
|
|
888
894
|
}
|
|
889
895
|
#line 342 "pitchfork_http.rl"
|
|
890
896
|
{
|
|
897
|
+
VALUE str;
|
|
898
|
+
|
|
891
899
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
892
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
900
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
901
|
+
|
|
902
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
903
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
904
|
+
}
|
|
893
905
|
}
|
|
894
|
-
#line
|
|
906
|
+
#line 375 "pitchfork_http.rl"
|
|
895
907
|
{
|
|
896
908
|
finalize_header(hp);
|
|
897
909
|
|
|
@@ -912,19 +924,25 @@ tr117:
|
|
|
912
924
|
}
|
|
913
925
|
goto st122;
|
|
914
926
|
tr124:
|
|
915
|
-
#line 355 "pitchfork_http.rl"
|
|
916
|
-
{MARK(start.query, p); }
|
|
917
927
|
#line 356 "pitchfork_http.rl"
|
|
928
|
+
{MARK(start.query, p); }
|
|
929
|
+
#line 357 "pitchfork_http.rl"
|
|
918
930
|
{
|
|
919
931
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
|
920
932
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
|
921
933
|
}
|
|
922
934
|
#line 342 "pitchfork_http.rl"
|
|
923
935
|
{
|
|
936
|
+
VALUE str;
|
|
937
|
+
|
|
924
938
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
925
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
939
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
940
|
+
|
|
941
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
942
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
943
|
+
}
|
|
926
944
|
}
|
|
927
|
-
#line
|
|
945
|
+
#line 375 "pitchfork_http.rl"
|
|
928
946
|
{
|
|
929
947
|
finalize_header(hp);
|
|
930
948
|
|
|
@@ -945,17 +963,23 @@ tr124:
|
|
|
945
963
|
}
|
|
946
964
|
goto st122;
|
|
947
965
|
tr129:
|
|
948
|
-
#line
|
|
966
|
+
#line 357 "pitchfork_http.rl"
|
|
949
967
|
{
|
|
950
968
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
|
951
969
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
|
952
970
|
}
|
|
953
971
|
#line 342 "pitchfork_http.rl"
|
|
954
972
|
{
|
|
973
|
+
VALUE str;
|
|
974
|
+
|
|
955
975
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
956
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
976
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
977
|
+
|
|
978
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
979
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
980
|
+
}
|
|
957
981
|
}
|
|
958
|
-
#line
|
|
982
|
+
#line 375 "pitchfork_http.rl"
|
|
959
983
|
{
|
|
960
984
|
finalize_header(hp);
|
|
961
985
|
|
|
@@ -979,90 +1003,102 @@ st122:
|
|
|
979
1003
|
if ( ++p == pe )
|
|
980
1004
|
goto _test_eof122;
|
|
981
1005
|
case 122:
|
|
982
|
-
#line
|
|
1006
|
+
#line 1007 "pitchfork_http.c"
|
|
983
1007
|
goto st0;
|
|
984
1008
|
tr105:
|
|
985
1009
|
#line 342 "pitchfork_http.rl"
|
|
986
1010
|
{
|
|
1011
|
+
VALUE str;
|
|
1012
|
+
|
|
987
1013
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
988
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1014
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1015
|
+
|
|
1016
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
1017
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
1018
|
+
}
|
|
989
1019
|
}
|
|
990
1020
|
goto st18;
|
|
991
1021
|
tr109:
|
|
992
1022
|
#line 328 "pitchfork_http.rl"
|
|
993
1023
|
{MARK(mark, p); }
|
|
994
|
-
#line
|
|
1024
|
+
#line 352 "pitchfork_http.rl"
|
|
995
1025
|
{
|
|
996
1026
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
|
997
|
-
|
|
998
|
-
if (STR_CSTR_EQ(str, "*")) {
|
|
999
|
-
VALUE str = rb_str_new("*", 1);
|
|
1000
|
-
rb_hash_aset(hp->env, g_path_info, str);
|
|
1001
|
-
rb_hash_aset(hp->env, g_request_path, str);
|
|
1002
|
-
}
|
|
1027
|
+
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
|
1003
1028
|
}
|
|
1004
1029
|
goto st18;
|
|
1005
1030
|
tr113:
|
|
1006
|
-
#line
|
|
1031
|
+
#line 352 "pitchfork_http.rl"
|
|
1007
1032
|
{
|
|
1008
1033
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), FRAGMENT);
|
|
1009
|
-
|
|
1010
|
-
if (STR_CSTR_EQ(str, "*")) {
|
|
1011
|
-
VALUE str = rb_str_new("*", 1);
|
|
1012
|
-
rb_hash_aset(hp->env, g_path_info, str);
|
|
1013
|
-
rb_hash_aset(hp->env, g_request_path, str);
|
|
1014
|
-
}
|
|
1034
|
+
rb_hash_aset(hp->env, g_fragment, STR_NEW(mark, p));
|
|
1015
1035
|
}
|
|
1016
1036
|
goto st18;
|
|
1017
1037
|
tr118:
|
|
1018
|
-
#line
|
|
1038
|
+
#line 362 "pitchfork_http.rl"
|
|
1019
1039
|
{
|
|
1020
1040
|
VALUE val;
|
|
1021
1041
|
|
|
1022
1042
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_PATH);
|
|
1023
1043
|
val = rb_hash_aset(hp->env, g_request_path, STR_NEW(mark, p));
|
|
1024
1044
|
|
|
1025
|
-
|
|
1026
|
-
if (!STR_CSTR_EQ(val, "*"))
|
|
1027
|
-
rb_hash_aset(hp->env, g_path_info, val);
|
|
1045
|
+
rb_hash_aset(hp->env, g_path_info, val);
|
|
1028
1046
|
}
|
|
1029
1047
|
#line 342 "pitchfork_http.rl"
|
|
1030
1048
|
{
|
|
1049
|
+
VALUE str;
|
|
1050
|
+
|
|
1031
1051
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
1032
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1052
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1053
|
+
|
|
1054
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
1055
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
1056
|
+
}
|
|
1033
1057
|
}
|
|
1034
1058
|
goto st18;
|
|
1035
1059
|
tr125:
|
|
1036
|
-
#line 355 "pitchfork_http.rl"
|
|
1037
|
-
{MARK(start.query, p); }
|
|
1038
1060
|
#line 356 "pitchfork_http.rl"
|
|
1061
|
+
{MARK(start.query, p); }
|
|
1062
|
+
#line 357 "pitchfork_http.rl"
|
|
1039
1063
|
{
|
|
1040
1064
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
|
1041
1065
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
|
1042
1066
|
}
|
|
1043
1067
|
#line 342 "pitchfork_http.rl"
|
|
1044
1068
|
{
|
|
1069
|
+
VALUE str;
|
|
1070
|
+
|
|
1045
1071
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
1046
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1072
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1073
|
+
|
|
1074
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
1075
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
1076
|
+
}
|
|
1047
1077
|
}
|
|
1048
1078
|
goto st18;
|
|
1049
1079
|
tr130:
|
|
1050
|
-
#line
|
|
1080
|
+
#line 357 "pitchfork_http.rl"
|
|
1051
1081
|
{
|
|
1052
1082
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
|
1053
1083
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
|
1054
1084
|
}
|
|
1055
1085
|
#line 342 "pitchfork_http.rl"
|
|
1056
1086
|
{
|
|
1087
|
+
VALUE str;
|
|
1088
|
+
|
|
1057
1089
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
1058
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1090
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1091
|
+
|
|
1092
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
1093
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
1094
|
+
}
|
|
1059
1095
|
}
|
|
1060
1096
|
goto st18;
|
|
1061
1097
|
st18:
|
|
1062
1098
|
if ( ++p == pe )
|
|
1063
1099
|
goto _test_eof18;
|
|
1064
1100
|
case 18:
|
|
1065
|
-
#line
|
|
1101
|
+
#line 1102 "pitchfork_http.c"
|
|
1066
1102
|
if ( (*p) == 10 )
|
|
1067
1103
|
goto tr21;
|
|
1068
1104
|
goto st0;
|
|
@@ -1080,7 +1116,7 @@ st19:
|
|
|
1080
1116
|
if ( ++p == pe )
|
|
1081
1117
|
goto _test_eof19;
|
|
1082
1118
|
case 19:
|
|
1083
|
-
#line
|
|
1119
|
+
#line 1120 "pitchfork_http.c"
|
|
1084
1120
|
switch( (*p) ) {
|
|
1085
1121
|
case 33: goto tr32;
|
|
1086
1122
|
case 58: goto tr33;
|
|
@@ -1117,7 +1153,7 @@ st20:
|
|
|
1117
1153
|
if ( ++p == pe )
|
|
1118
1154
|
goto _test_eof20;
|
|
1119
1155
|
case 20:
|
|
1120
|
-
#line
|
|
1156
|
+
#line 1157 "pitchfork_http.c"
|
|
1121
1157
|
switch( (*p) ) {
|
|
1122
1158
|
case 9: goto tr35;
|
|
1123
1159
|
case 10: goto tr36;
|
|
@@ -1136,7 +1172,7 @@ st21:
|
|
|
1136
1172
|
if ( ++p == pe )
|
|
1137
1173
|
goto _test_eof21;
|
|
1138
1174
|
case 21:
|
|
1139
|
-
#line
|
|
1175
|
+
#line 1176 "pitchfork_http.c"
|
|
1140
1176
|
switch( (*p) ) {
|
|
1141
1177
|
case 10: goto tr39;
|
|
1142
1178
|
case 13: goto tr40;
|
|
@@ -1151,59 +1187,81 @@ case 21:
|
|
|
1151
1187
|
tr9:
|
|
1152
1188
|
#line 342 "pitchfork_http.rl"
|
|
1153
1189
|
{
|
|
1190
|
+
VALUE str;
|
|
1191
|
+
|
|
1154
1192
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
1155
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1193
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1194
|
+
|
|
1195
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
1196
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
1197
|
+
}
|
|
1156
1198
|
}
|
|
1157
1199
|
goto st22;
|
|
1158
1200
|
tr50:
|
|
1159
|
-
#line
|
|
1201
|
+
#line 362 "pitchfork_http.rl"
|
|
1160
1202
|
{
|
|
1161
1203
|
VALUE val;
|
|
1162
1204
|
|
|
1163
1205
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_PATH);
|
|
1164
1206
|
val = rb_hash_aset(hp->env, g_request_path, STR_NEW(mark, p));
|
|
1165
1207
|
|
|
1166
|
-
|
|
1167
|
-
if (!STR_CSTR_EQ(val, "*"))
|
|
1168
|
-
rb_hash_aset(hp->env, g_path_info, val);
|
|
1208
|
+
rb_hash_aset(hp->env, g_path_info, val);
|
|
1169
1209
|
}
|
|
1170
1210
|
#line 342 "pitchfork_http.rl"
|
|
1171
1211
|
{
|
|
1212
|
+
VALUE str;
|
|
1213
|
+
|
|
1172
1214
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
1173
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1215
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1216
|
+
|
|
1217
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
1218
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
1219
|
+
}
|
|
1174
1220
|
}
|
|
1175
1221
|
goto st22;
|
|
1176
1222
|
tr56:
|
|
1177
|
-
#line 355 "pitchfork_http.rl"
|
|
1178
|
-
{MARK(start.query, p); }
|
|
1179
1223
|
#line 356 "pitchfork_http.rl"
|
|
1224
|
+
{MARK(start.query, p); }
|
|
1225
|
+
#line 357 "pitchfork_http.rl"
|
|
1180
1226
|
{
|
|
1181
1227
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
|
1182
1228
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
|
1183
1229
|
}
|
|
1184
1230
|
#line 342 "pitchfork_http.rl"
|
|
1185
1231
|
{
|
|
1232
|
+
VALUE str;
|
|
1233
|
+
|
|
1186
1234
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
1187
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1235
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1236
|
+
|
|
1237
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
1238
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
1239
|
+
}
|
|
1188
1240
|
}
|
|
1189
1241
|
goto st22;
|
|
1190
1242
|
tr60:
|
|
1191
|
-
#line
|
|
1243
|
+
#line 357 "pitchfork_http.rl"
|
|
1192
1244
|
{
|
|
1193
1245
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
|
1194
1246
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
|
1195
1247
|
}
|
|
1196
1248
|
#line 342 "pitchfork_http.rl"
|
|
1197
1249
|
{
|
|
1250
|
+
VALUE str;
|
|
1251
|
+
|
|
1198
1252
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
1199
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1253
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
1254
|
+
|
|
1255
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
1256
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
1257
|
+
}
|
|
1200
1258
|
}
|
|
1201
1259
|
goto st22;
|
|
1202
1260
|
st22:
|
|
1203
1261
|
if ( ++p == pe )
|
|
1204
1262
|
goto _test_eof22;
|
|
1205
1263
|
case 22:
|
|
1206
|
-
#line
|
|
1264
|
+
#line 1265 "pitchfork_http.c"
|
|
1207
1265
|
switch( (*p) ) {
|
|
1208
1266
|
case 32: goto tr42;
|
|
1209
1267
|
case 35: goto st0;
|
|
@@ -1221,7 +1279,7 @@ st23:
|
|
|
1221
1279
|
if ( ++p == pe )
|
|
1222
1280
|
goto _test_eof23;
|
|
1223
1281
|
case 23:
|
|
1224
|
-
#line
|
|
1282
|
+
#line 1283 "pitchfork_http.c"
|
|
1225
1283
|
switch( (*p) ) {
|
|
1226
1284
|
case 32: goto tr45;
|
|
1227
1285
|
case 35: goto st0;
|
|
@@ -1239,7 +1297,7 @@ st24:
|
|
|
1239
1297
|
if ( ++p == pe )
|
|
1240
1298
|
goto _test_eof24;
|
|
1241
1299
|
case 24:
|
|
1242
|
-
#line
|
|
1300
|
+
#line 1301 "pitchfork_http.c"
|
|
1243
1301
|
if ( (*p) < 65 ) {
|
|
1244
1302
|
if ( 48 <= (*p) && (*p) <= 57 )
|
|
1245
1303
|
goto st25;
|
|
@@ -1276,7 +1334,7 @@ st26:
|
|
|
1276
1334
|
if ( ++p == pe )
|
|
1277
1335
|
goto _test_eof26;
|
|
1278
1336
|
case 26:
|
|
1279
|
-
#line
|
|
1337
|
+
#line 1338 "pitchfork_http.c"
|
|
1280
1338
|
switch( (*p) ) {
|
|
1281
1339
|
case 32: goto tr49;
|
|
1282
1340
|
case 35: goto tr50;
|
|
@@ -1314,23 +1372,21 @@ case 28:
|
|
|
1314
1372
|
goto st26;
|
|
1315
1373
|
goto st0;
|
|
1316
1374
|
tr52:
|
|
1317
|
-
#line
|
|
1375
|
+
#line 362 "pitchfork_http.rl"
|
|
1318
1376
|
{
|
|
1319
1377
|
VALUE val;
|
|
1320
1378
|
|
|
1321
1379
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_PATH);
|
|
1322
1380
|
val = rb_hash_aset(hp->env, g_request_path, STR_NEW(mark, p));
|
|
1323
1381
|
|
|
1324
|
-
|
|
1325
|
-
if (!STR_CSTR_EQ(val, "*"))
|
|
1326
|
-
rb_hash_aset(hp->env, g_path_info, val);
|
|
1382
|
+
rb_hash_aset(hp->env, g_path_info, val);
|
|
1327
1383
|
}
|
|
1328
1384
|
goto st29;
|
|
1329
1385
|
st29:
|
|
1330
1386
|
if ( ++p == pe )
|
|
1331
1387
|
goto _test_eof29;
|
|
1332
1388
|
case 29:
|
|
1333
|
-
#line
|
|
1389
|
+
#line 1390 "pitchfork_http.c"
|
|
1334
1390
|
switch( (*p) ) {
|
|
1335
1391
|
case 32: goto tr55;
|
|
1336
1392
|
case 35: goto tr56;
|
|
@@ -1341,14 +1397,14 @@ case 29:
|
|
|
1341
1397
|
goto st0;
|
|
1342
1398
|
goto tr54;
|
|
1343
1399
|
tr54:
|
|
1344
|
-
#line
|
|
1400
|
+
#line 356 "pitchfork_http.rl"
|
|
1345
1401
|
{MARK(start.query, p); }
|
|
1346
1402
|
goto st30;
|
|
1347
1403
|
st30:
|
|
1348
1404
|
if ( ++p == pe )
|
|
1349
1405
|
goto _test_eof30;
|
|
1350
1406
|
case 30:
|
|
1351
|
-
#line
|
|
1407
|
+
#line 1408 "pitchfork_http.c"
|
|
1352
1408
|
switch( (*p) ) {
|
|
1353
1409
|
case 32: goto tr59;
|
|
1354
1410
|
case 35: goto tr60;
|
|
@@ -1359,14 +1415,14 @@ case 30:
|
|
|
1359
1415
|
goto st0;
|
|
1360
1416
|
goto st30;
|
|
1361
1417
|
tr57:
|
|
1362
|
-
#line
|
|
1418
|
+
#line 356 "pitchfork_http.rl"
|
|
1363
1419
|
{MARK(start.query, p); }
|
|
1364
1420
|
goto st31;
|
|
1365
1421
|
st31:
|
|
1366
1422
|
if ( ++p == pe )
|
|
1367
1423
|
goto _test_eof31;
|
|
1368
1424
|
case 31:
|
|
1369
|
-
#line
|
|
1425
|
+
#line 1426 "pitchfork_http.c"
|
|
1370
1426
|
if ( (*p) < 65 ) {
|
|
1371
1427
|
if ( 48 <= (*p) && (*p) <= 57 )
|
|
1372
1428
|
goto st32;
|
|
@@ -1399,7 +1455,7 @@ st33:
|
|
|
1399
1455
|
if ( ++p == pe )
|
|
1400
1456
|
goto _test_eof33;
|
|
1401
1457
|
case 33:
|
|
1402
|
-
#line
|
|
1458
|
+
#line 1459 "pitchfork_http.c"
|
|
1403
1459
|
switch( (*p) ) {
|
|
1404
1460
|
case 84: goto tr63;
|
|
1405
1461
|
case 116: goto tr63;
|
|
@@ -1413,7 +1469,7 @@ st34:
|
|
|
1413
1469
|
if ( ++p == pe )
|
|
1414
1470
|
goto _test_eof34;
|
|
1415
1471
|
case 34:
|
|
1416
|
-
#line
|
|
1472
|
+
#line 1473 "pitchfork_http.c"
|
|
1417
1473
|
switch( (*p) ) {
|
|
1418
1474
|
case 84: goto tr64;
|
|
1419
1475
|
case 116: goto tr64;
|
|
@@ -1427,7 +1483,7 @@ st35:
|
|
|
1427
1483
|
if ( ++p == pe )
|
|
1428
1484
|
goto _test_eof35;
|
|
1429
1485
|
case 35:
|
|
1430
|
-
#line
|
|
1486
|
+
#line 1487 "pitchfork_http.c"
|
|
1431
1487
|
switch( (*p) ) {
|
|
1432
1488
|
case 80: goto tr65;
|
|
1433
1489
|
case 112: goto tr65;
|
|
@@ -1441,7 +1497,7 @@ st36:
|
|
|
1441
1497
|
if ( ++p == pe )
|
|
1442
1498
|
goto _test_eof36;
|
|
1443
1499
|
case 36:
|
|
1444
|
-
#line
|
|
1500
|
+
#line 1501 "pitchfork_http.c"
|
|
1445
1501
|
switch( (*p) ) {
|
|
1446
1502
|
case 58: goto tr66;
|
|
1447
1503
|
case 83: goto tr67;
|
|
@@ -1458,7 +1514,7 @@ st37:
|
|
|
1458
1514
|
if ( ++p == pe )
|
|
1459
1515
|
goto _test_eof37;
|
|
1460
1516
|
case 37:
|
|
1461
|
-
#line
|
|
1517
|
+
#line 1518 "pitchfork_http.c"
|
|
1462
1518
|
if ( (*p) == 47 )
|
|
1463
1519
|
goto st38;
|
|
1464
1520
|
goto st0;
|
|
@@ -1553,7 +1609,7 @@ st43:
|
|
|
1553
1609
|
if ( ++p == pe )
|
|
1554
1610
|
goto _test_eof43;
|
|
1555
1611
|
case 43:
|
|
1556
|
-
#line
|
|
1612
|
+
#line 1613 "pitchfork_http.c"
|
|
1557
1613
|
switch( (*p) ) {
|
|
1558
1614
|
case 37: goto st41;
|
|
1559
1615
|
case 47: goto tr76;
|
|
@@ -1612,7 +1668,7 @@ st45:
|
|
|
1612
1668
|
if ( ++p == pe )
|
|
1613
1669
|
goto _test_eof45;
|
|
1614
1670
|
case 45:
|
|
1615
|
-
#line
|
|
1671
|
+
#line 1672 "pitchfork_http.c"
|
|
1616
1672
|
switch( (*p) ) {
|
|
1617
1673
|
case 37: goto st41;
|
|
1618
1674
|
case 47: goto st0;
|
|
@@ -1697,7 +1753,7 @@ st48:
|
|
|
1697
1753
|
if ( ++p == pe )
|
|
1698
1754
|
goto _test_eof48;
|
|
1699
1755
|
case 48:
|
|
1700
|
-
#line
|
|
1756
|
+
#line 1757 "pitchfork_http.c"
|
|
1701
1757
|
if ( (*p) == 58 )
|
|
1702
1758
|
goto tr66;
|
|
1703
1759
|
goto st0;
|
|
@@ -2220,7 +2276,7 @@ st68:
|
|
|
2220
2276
|
if ( ++p == pe )
|
|
2221
2277
|
goto _test_eof68;
|
|
2222
2278
|
case 68:
|
|
2223
|
-
#line
|
|
2279
|
+
#line 2280 "pitchfork_http.c"
|
|
2224
2280
|
switch( (*p) ) {
|
|
2225
2281
|
case 32: goto tr3;
|
|
2226
2282
|
case 33: goto st49;
|
|
@@ -2311,7 +2367,7 @@ st71:
|
|
|
2311
2367
|
if ( ++p == pe )
|
|
2312
2368
|
goto _test_eof71;
|
|
2313
2369
|
case 71:
|
|
2314
|
-
#line
|
|
2370
|
+
#line 2371 "pitchfork_http.c"
|
|
2315
2371
|
switch( (*p) ) {
|
|
2316
2372
|
case 42: goto tr101;
|
|
2317
2373
|
case 47: goto tr102;
|
|
@@ -2327,7 +2383,7 @@ st72:
|
|
|
2327
2383
|
if ( ++p == pe )
|
|
2328
2384
|
goto _test_eof72;
|
|
2329
2385
|
case 72:
|
|
2330
|
-
#line
|
|
2386
|
+
#line 2387 "pitchfork_http.c"
|
|
2331
2387
|
switch( (*p) ) {
|
|
2332
2388
|
case 10: goto tr104;
|
|
2333
2389
|
case 13: goto tr105;
|
|
@@ -2338,59 +2394,81 @@ case 72:
|
|
|
2338
2394
|
tr106:
|
|
2339
2395
|
#line 342 "pitchfork_http.rl"
|
|
2340
2396
|
{
|
|
2397
|
+
VALUE str;
|
|
2398
|
+
|
|
2341
2399
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
2342
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
2400
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
2401
|
+
|
|
2402
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
2403
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
2404
|
+
}
|
|
2343
2405
|
}
|
|
2344
2406
|
goto st73;
|
|
2345
2407
|
tr119:
|
|
2346
|
-
#line
|
|
2408
|
+
#line 362 "pitchfork_http.rl"
|
|
2347
2409
|
{
|
|
2348
2410
|
VALUE val;
|
|
2349
2411
|
|
|
2350
2412
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_PATH);
|
|
2351
2413
|
val = rb_hash_aset(hp->env, g_request_path, STR_NEW(mark, p));
|
|
2352
2414
|
|
|
2353
|
-
|
|
2354
|
-
if (!STR_CSTR_EQ(val, "*"))
|
|
2355
|
-
rb_hash_aset(hp->env, g_path_info, val);
|
|
2415
|
+
rb_hash_aset(hp->env, g_path_info, val);
|
|
2356
2416
|
}
|
|
2357
2417
|
#line 342 "pitchfork_http.rl"
|
|
2358
2418
|
{
|
|
2419
|
+
VALUE str;
|
|
2420
|
+
|
|
2359
2421
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
2360
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
2422
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
2423
|
+
|
|
2424
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
2425
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
2426
|
+
}
|
|
2361
2427
|
}
|
|
2362
2428
|
goto st73;
|
|
2363
2429
|
tr126:
|
|
2364
|
-
#line 355 "pitchfork_http.rl"
|
|
2365
|
-
{MARK(start.query, p); }
|
|
2366
2430
|
#line 356 "pitchfork_http.rl"
|
|
2431
|
+
{MARK(start.query, p); }
|
|
2432
|
+
#line 357 "pitchfork_http.rl"
|
|
2367
2433
|
{
|
|
2368
2434
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
|
2369
2435
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
|
2370
2436
|
}
|
|
2371
2437
|
#line 342 "pitchfork_http.rl"
|
|
2372
2438
|
{
|
|
2439
|
+
VALUE str;
|
|
2440
|
+
|
|
2373
2441
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
2374
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
2442
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
2443
|
+
|
|
2444
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
2445
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
2446
|
+
}
|
|
2375
2447
|
}
|
|
2376
2448
|
goto st73;
|
|
2377
2449
|
tr131:
|
|
2378
|
-
#line
|
|
2450
|
+
#line 357 "pitchfork_http.rl"
|
|
2379
2451
|
{
|
|
2380
2452
|
VALIDATE_MAX_URI_LENGTH(LEN(start.query, p), QUERY_STRING);
|
|
2381
2453
|
rb_hash_aset(hp->env, g_query_string, STR_NEW(start.query, p));
|
|
2382
2454
|
}
|
|
2383
2455
|
#line 342 "pitchfork_http.rl"
|
|
2384
2456
|
{
|
|
2457
|
+
VALUE str;
|
|
2458
|
+
|
|
2385
2459
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_URI);
|
|
2386
|
-
rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
2460
|
+
str = rb_hash_aset(hp->env, g_request_uri, STR_NEW(mark, p));
|
|
2461
|
+
|
|
2462
|
+
if (STR_CSTR_EQ(str, "*")) {
|
|
2463
|
+
rb_hash_aset(hp->env, g_path_info, str);
|
|
2464
|
+
}
|
|
2387
2465
|
}
|
|
2388
2466
|
goto st73;
|
|
2389
2467
|
st73:
|
|
2390
2468
|
if ( ++p == pe )
|
|
2391
2469
|
goto _test_eof73;
|
|
2392
2470
|
case 73:
|
|
2393
|
-
#line
|
|
2471
|
+
#line 2472 "pitchfork_http.c"
|
|
2394
2472
|
switch( (*p) ) {
|
|
2395
2473
|
case 10: goto tr108;
|
|
2396
2474
|
case 13: goto tr109;
|
|
@@ -2410,7 +2488,7 @@ st74:
|
|
|
2410
2488
|
if ( ++p == pe )
|
|
2411
2489
|
goto _test_eof74;
|
|
2412
2490
|
case 74:
|
|
2413
|
-
#line
|
|
2491
|
+
#line 2492 "pitchfork_http.c"
|
|
2414
2492
|
switch( (*p) ) {
|
|
2415
2493
|
case 10: goto tr112;
|
|
2416
2494
|
case 13: goto tr113;
|
|
@@ -2430,7 +2508,7 @@ st75:
|
|
|
2430
2508
|
if ( ++p == pe )
|
|
2431
2509
|
goto _test_eof75;
|
|
2432
2510
|
case 75:
|
|
2433
|
-
#line
|
|
2511
|
+
#line 2512 "pitchfork_http.c"
|
|
2434
2512
|
if ( (*p) < 65 ) {
|
|
2435
2513
|
if ( 48 <= (*p) && (*p) <= 57 )
|
|
2436
2514
|
goto st76;
|
|
@@ -2467,7 +2545,7 @@ st77:
|
|
|
2467
2545
|
if ( ++p == pe )
|
|
2468
2546
|
goto _test_eof77;
|
|
2469
2547
|
case 77:
|
|
2470
|
-
#line
|
|
2548
|
+
#line 2549 "pitchfork_http.c"
|
|
2471
2549
|
switch( (*p) ) {
|
|
2472
2550
|
case 10: goto tr117;
|
|
2473
2551
|
case 13: goto tr118;
|
|
@@ -2507,23 +2585,21 @@ case 79:
|
|
|
2507
2585
|
goto st77;
|
|
2508
2586
|
goto st0;
|
|
2509
2587
|
tr121:
|
|
2510
|
-
#line
|
|
2588
|
+
#line 362 "pitchfork_http.rl"
|
|
2511
2589
|
{
|
|
2512
2590
|
VALUE val;
|
|
2513
2591
|
|
|
2514
2592
|
VALIDATE_MAX_URI_LENGTH(LEN(mark, p), REQUEST_PATH);
|
|
2515
2593
|
val = rb_hash_aset(hp->env, g_request_path, STR_NEW(mark, p));
|
|
2516
2594
|
|
|
2517
|
-
|
|
2518
|
-
if (!STR_CSTR_EQ(val, "*"))
|
|
2519
|
-
rb_hash_aset(hp->env, g_path_info, val);
|
|
2595
|
+
rb_hash_aset(hp->env, g_path_info, val);
|
|
2520
2596
|
}
|
|
2521
2597
|
goto st80;
|
|
2522
2598
|
st80:
|
|
2523
2599
|
if ( ++p == pe )
|
|
2524
2600
|
goto _test_eof80;
|
|
2525
2601
|
case 80:
|
|
2526
|
-
#line
|
|
2602
|
+
#line 2603 "pitchfork_http.c"
|
|
2527
2603
|
switch( (*p) ) {
|
|
2528
2604
|
case 10: goto tr124;
|
|
2529
2605
|
case 13: goto tr125;
|
|
@@ -2536,14 +2612,14 @@ case 80:
|
|
|
2536
2612
|
goto st0;
|
|
2537
2613
|
goto tr123;
|
|
2538
2614
|
tr123:
|
|
2539
|
-
#line
|
|
2615
|
+
#line 356 "pitchfork_http.rl"
|
|
2540
2616
|
{MARK(start.query, p); }
|
|
2541
2617
|
goto st81;
|
|
2542
2618
|
st81:
|
|
2543
2619
|
if ( ++p == pe )
|
|
2544
2620
|
goto _test_eof81;
|
|
2545
2621
|
case 81:
|
|
2546
|
-
#line
|
|
2622
|
+
#line 2623 "pitchfork_http.c"
|
|
2547
2623
|
switch( (*p) ) {
|
|
2548
2624
|
case 10: goto tr129;
|
|
2549
2625
|
case 13: goto tr130;
|
|
@@ -2556,14 +2632,14 @@ case 81:
|
|
|
2556
2632
|
goto st0;
|
|
2557
2633
|
goto st81;
|
|
2558
2634
|
tr127:
|
|
2559
|
-
#line
|
|
2635
|
+
#line 356 "pitchfork_http.rl"
|
|
2560
2636
|
{MARK(start.query, p); }
|
|
2561
2637
|
goto st82;
|
|
2562
2638
|
st82:
|
|
2563
2639
|
if ( ++p == pe )
|
|
2564
2640
|
goto _test_eof82;
|
|
2565
2641
|
case 82:
|
|
2566
|
-
#line
|
|
2642
|
+
#line 2643 "pitchfork_http.c"
|
|
2567
2643
|
if ( (*p) < 65 ) {
|
|
2568
2644
|
if ( 48 <= (*p) && (*p) <= 57 )
|
|
2569
2645
|
goto st83;
|
|
@@ -2596,7 +2672,7 @@ st84:
|
|
|
2596
2672
|
if ( ++p == pe )
|
|
2597
2673
|
goto _test_eof84;
|
|
2598
2674
|
case 84:
|
|
2599
|
-
#line
|
|
2675
|
+
#line 2676 "pitchfork_http.c"
|
|
2600
2676
|
switch( (*p) ) {
|
|
2601
2677
|
case 84: goto tr134;
|
|
2602
2678
|
case 116: goto tr134;
|
|
@@ -2610,7 +2686,7 @@ st85:
|
|
|
2610
2686
|
if ( ++p == pe )
|
|
2611
2687
|
goto _test_eof85;
|
|
2612
2688
|
case 85:
|
|
2613
|
-
#line
|
|
2689
|
+
#line 2690 "pitchfork_http.c"
|
|
2614
2690
|
switch( (*p) ) {
|
|
2615
2691
|
case 84: goto tr135;
|
|
2616
2692
|
case 116: goto tr135;
|
|
@@ -2624,7 +2700,7 @@ st86:
|
|
|
2624
2700
|
if ( ++p == pe )
|
|
2625
2701
|
goto _test_eof86;
|
|
2626
2702
|
case 86:
|
|
2627
|
-
#line
|
|
2703
|
+
#line 2704 "pitchfork_http.c"
|
|
2628
2704
|
switch( (*p) ) {
|
|
2629
2705
|
case 80: goto tr136;
|
|
2630
2706
|
case 112: goto tr136;
|
|
@@ -2638,7 +2714,7 @@ st87:
|
|
|
2638
2714
|
if ( ++p == pe )
|
|
2639
2715
|
goto _test_eof87;
|
|
2640
2716
|
case 87:
|
|
2641
|
-
#line
|
|
2717
|
+
#line 2718 "pitchfork_http.c"
|
|
2642
2718
|
switch( (*p) ) {
|
|
2643
2719
|
case 58: goto tr137;
|
|
2644
2720
|
case 83: goto tr138;
|
|
@@ -2655,7 +2731,7 @@ st88:
|
|
|
2655
2731
|
if ( ++p == pe )
|
|
2656
2732
|
goto _test_eof88;
|
|
2657
2733
|
case 88:
|
|
2658
|
-
#line
|
|
2734
|
+
#line 2735 "pitchfork_http.c"
|
|
2659
2735
|
if ( (*p) == 47 )
|
|
2660
2736
|
goto st89;
|
|
2661
2737
|
goto st0;
|
|
@@ -2750,7 +2826,7 @@ st94:
|
|
|
2750
2826
|
if ( ++p == pe )
|
|
2751
2827
|
goto _test_eof94;
|
|
2752
2828
|
case 94:
|
|
2753
|
-
#line
|
|
2829
|
+
#line 2830 "pitchfork_http.c"
|
|
2754
2830
|
switch( (*p) ) {
|
|
2755
2831
|
case 37: goto st92;
|
|
2756
2832
|
case 47: goto tr147;
|
|
@@ -2809,7 +2885,7 @@ st96:
|
|
|
2809
2885
|
if ( ++p == pe )
|
|
2810
2886
|
goto _test_eof96;
|
|
2811
2887
|
case 96:
|
|
2812
|
-
#line
|
|
2888
|
+
#line 2889 "pitchfork_http.c"
|
|
2813
2889
|
switch( (*p) ) {
|
|
2814
2890
|
case 37: goto st92;
|
|
2815
2891
|
case 47: goto st0;
|
|
@@ -2894,7 +2970,7 @@ st99:
|
|
|
2894
2970
|
if ( ++p == pe )
|
|
2895
2971
|
goto _test_eof99;
|
|
2896
2972
|
case 99:
|
|
2897
|
-
#line
|
|
2973
|
+
#line 2974 "pitchfork_http.c"
|
|
2898
2974
|
if ( (*p) == 58 )
|
|
2899
2975
|
goto tr137;
|
|
2900
2976
|
goto st0;
|
|
@@ -2914,7 +2990,7 @@ case 100:
|
|
|
2914
2990
|
goto tr152;
|
|
2915
2991
|
goto st0;
|
|
2916
2992
|
tr151:
|
|
2917
|
-
#line
|
|
2993
|
+
#line 370 "pitchfork_http.rl"
|
|
2918
2994
|
{
|
|
2919
2995
|
hp->len.chunk = step_incr(hp->len.chunk, (*p), 16);
|
|
2920
2996
|
if (hp->len.chunk < 0)
|
|
@@ -2925,7 +3001,7 @@ st101:
|
|
|
2925
3001
|
if ( ++p == pe )
|
|
2926
3002
|
goto _test_eof101;
|
|
2927
3003
|
case 101:
|
|
2928
|
-
#line
|
|
3004
|
+
#line 3005 "pitchfork_http.c"
|
|
2929
3005
|
switch( (*p) ) {
|
|
2930
3006
|
case 10: goto tr153;
|
|
2931
3007
|
case 13: goto st102;
|
|
@@ -2942,7 +3018,7 @@ case 101:
|
|
|
2942
3018
|
goto tr152;
|
|
2943
3019
|
goto st0;
|
|
2944
3020
|
tr153:
|
|
2945
|
-
#line
|
|
3021
|
+
#line 399 "pitchfork_http.rl"
|
|
2946
3022
|
{
|
|
2947
3023
|
HP_FL_SET(hp, INTRAILER);
|
|
2948
3024
|
cs = http_parser_en_Trailers;
|
|
@@ -2955,7 +3031,7 @@ st123:
|
|
|
2955
3031
|
if ( ++p == pe )
|
|
2956
3032
|
goto _test_eof123;
|
|
2957
3033
|
case 123:
|
|
2958
|
-
#line
|
|
3034
|
+
#line 3035 "pitchfork_http.c"
|
|
2959
3035
|
goto st0;
|
|
2960
3036
|
st102:
|
|
2961
3037
|
if ( ++p == pe )
|
|
@@ -2965,7 +3041,7 @@ case 102:
|
|
|
2965
3041
|
goto tr153;
|
|
2966
3042
|
goto st0;
|
|
2967
3043
|
tr152:
|
|
2968
|
-
#line
|
|
3044
|
+
#line 370 "pitchfork_http.rl"
|
|
2969
3045
|
{
|
|
2970
3046
|
hp->len.chunk = step_incr(hp->len.chunk, (*p), 16);
|
|
2971
3047
|
if (hp->len.chunk < 0)
|
|
@@ -2976,7 +3052,7 @@ st103:
|
|
|
2976
3052
|
if ( ++p == pe )
|
|
2977
3053
|
goto _test_eof103;
|
|
2978
3054
|
case 103:
|
|
2979
|
-
#line
|
|
3055
|
+
#line 3056 "pitchfork_http.c"
|
|
2980
3056
|
switch( (*p) ) {
|
|
2981
3057
|
case 10: goto st104;
|
|
2982
3058
|
case 13: goto st107;
|
|
@@ -2997,7 +3073,7 @@ st104:
|
|
|
2997
3073
|
case 104:
|
|
2998
3074
|
goto tr159;
|
|
2999
3075
|
tr159:
|
|
3000
|
-
#line
|
|
3076
|
+
#line 407 "pitchfork_http.rl"
|
|
3001
3077
|
{
|
|
3002
3078
|
skip_chunk_data_hack: {
|
|
3003
3079
|
size_t nr = MIN((size_t)hp->len.chunk, REMAINING);
|
|
@@ -3019,7 +3095,7 @@ st105:
|
|
|
3019
3095
|
if ( ++p == pe )
|
|
3020
3096
|
goto _test_eof105;
|
|
3021
3097
|
case 105:
|
|
3022
|
-
#line
|
|
3098
|
+
#line 3099 "pitchfork_http.c"
|
|
3023
3099
|
switch( (*p) ) {
|
|
3024
3100
|
case 10: goto st100;
|
|
3025
3101
|
case 13: goto st106;
|
|
@@ -3249,7 +3325,7 @@ st114:
|
|
|
3249
3325
|
if ( ++p == pe )
|
|
3250
3326
|
goto _test_eof114;
|
|
3251
3327
|
case 114:
|
|
3252
|
-
#line
|
|
3328
|
+
#line 3329 "pitchfork_http.c"
|
|
3253
3329
|
switch( (*p) ) {
|
|
3254
3330
|
case 9: goto st115;
|
|
3255
3331
|
case 10: goto tr167;
|
|
@@ -3285,7 +3361,7 @@ st115:
|
|
|
3285
3361
|
if ( ++p == pe )
|
|
3286
3362
|
goto _test_eof115;
|
|
3287
3363
|
case 115:
|
|
3288
|
-
#line
|
|
3364
|
+
#line 3365 "pitchfork_http.c"
|
|
3289
3365
|
switch( (*p) ) {
|
|
3290
3366
|
case 9: goto tr171;
|
|
3291
3367
|
case 10: goto tr172;
|
|
@@ -3304,7 +3380,7 @@ st116:
|
|
|
3304
3380
|
if ( ++p == pe )
|
|
3305
3381
|
goto _test_eof116;
|
|
3306
3382
|
case 116:
|
|
3307
|
-
#line
|
|
3383
|
+
#line 3384 "pitchfork_http.c"
|
|
3308
3384
|
switch( (*p) ) {
|
|
3309
3385
|
case 10: goto tr175;
|
|
3310
3386
|
case 13: goto tr176;
|
|
@@ -3340,12 +3416,12 @@ st117:
|
|
|
3340
3416
|
if ( ++p == pe )
|
|
3341
3417
|
goto _test_eof117;
|
|
3342
3418
|
case 117:
|
|
3343
|
-
#line
|
|
3419
|
+
#line 3420 "pitchfork_http.c"
|
|
3344
3420
|
if ( (*p) == 10 )
|
|
3345
3421
|
goto st114;
|
|
3346
3422
|
goto st0;
|
|
3347
3423
|
tr167:
|
|
3348
|
-
#line
|
|
3424
|
+
#line 394 "pitchfork_http.rl"
|
|
3349
3425
|
{
|
|
3350
3426
|
cs = http_parser_first_final;
|
|
3351
3427
|
goto post_exec;
|
|
@@ -3355,7 +3431,7 @@ st124:
|
|
|
3355
3431
|
if ( ++p == pe )
|
|
3356
3432
|
goto _test_eof124;
|
|
3357
3433
|
case 124:
|
|
3358
|
-
#line
|
|
3434
|
+
#line 3435 "pitchfork_http.c"
|
|
3359
3435
|
goto st0;
|
|
3360
3436
|
st118:
|
|
3361
3437
|
if ( ++p == pe )
|
|
@@ -3378,7 +3454,7 @@ st119:
|
|
|
3378
3454
|
if ( ++p == pe )
|
|
3379
3455
|
goto _test_eof119;
|
|
3380
3456
|
case 119:
|
|
3381
|
-
#line
|
|
3457
|
+
#line 3458 "pitchfork_http.c"
|
|
3382
3458
|
switch( (*p) ) {
|
|
3383
3459
|
case 33: goto tr178;
|
|
3384
3460
|
case 58: goto tr179;
|
|
@@ -3415,7 +3491,7 @@ st120:
|
|
|
3415
3491
|
if ( ++p == pe )
|
|
3416
3492
|
goto _test_eof120;
|
|
3417
3493
|
case 120:
|
|
3418
|
-
#line
|
|
3494
|
+
#line 3495 "pitchfork_http.c"
|
|
3419
3495
|
switch( (*p) ) {
|
|
3420
3496
|
case 9: goto tr181;
|
|
3421
3497
|
case 10: goto tr182;
|
|
@@ -3434,7 +3510,7 @@ st121:
|
|
|
3434
3510
|
if ( ++p == pe )
|
|
3435
3511
|
goto _test_eof121;
|
|
3436
3512
|
case 121:
|
|
3437
|
-
#line
|
|
3513
|
+
#line 3514 "pitchfork_http.c"
|
|
3438
3514
|
switch( (*p) ) {
|
|
3439
3515
|
case 10: goto tr185;
|
|
3440
3516
|
case 13: goto tr186;
|
|
@@ -3575,7 +3651,7 @@ case 121:
|
|
|
3575
3651
|
_out: {}
|
|
3576
3652
|
}
|
|
3577
3653
|
|
|
3578
|
-
#line
|
|
3654
|
+
#line 468 "pitchfork_http.rl"
|
|
3579
3655
|
post_exec: /* "_out:" also goes here */
|
|
3580
3656
|
if (hp->cs != http_parser_error)
|
|
3581
3657
|
hp->cs = cs;
|