Skip to content

Commit 0283e68

Browse files
committed
Upgrade http_parser, allows quotes in URI
http_parser needs to be upgraded to latest code. Currently running off the v0.2 branch, which is missing the latest fixes.
1 parent 2dbd0d3 commit 0283e68

File tree

3 files changed

+57
-50
lines changed

3 files changed

+57
-50
lines changed

deps/http_parser/http_parser.c

Lines changed: 41 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,15 +3033,13 @@ case 106:
30333033
#line 3034 "http_parser.c"
30343034
switch( (*p) ) {
30353035
case 32: goto tr124;
3036+
case 35: goto st0;
30363037
case 37: goto tr125;
30373038
case 60: goto st0;
30383039
case 62: goto st0;
30393040
case 127: goto st0;
30403041
}
3041-
if ( (*p) > 31 ) {
3042-
if ( 34 <= (*p) && (*p) <= 35 )
3043-
goto st0;
3044-
} else if ( (*p) >= 0 )
3042+
if ( 0 <= (*p) && (*p) <= 31 )
30453043
goto st0;
30463044
goto tr123;
30473045
tr123:
@@ -3055,18 +3053,16 @@ case 106:
30553053
if ( ++p == pe )
30563054
goto _test_eof107;
30573055
case 107:
3058-
#line 3059 "http_parser.c"
3056+
#line 3057 "http_parser.c"
30593057
switch( (*p) ) {
30603058
case 32: goto tr127;
3059+
case 35: goto st0;
30613060
case 37: goto st108;
30623061
case 60: goto st0;
30633062
case 62: goto st0;
30643063
case 127: goto st0;
30653064
}
3066-
if ( (*p) > 31 ) {
3067-
if ( 34 <= (*p) && (*p) <= 35 )
3068-
goto st0;
3069-
} else if ( (*p) >= 0 )
3065+
if ( 0 <= (*p) && (*p) <= 31 )
30703066
goto st0;
30713067
goto st107;
30723068
tr125:
@@ -3080,7 +3076,7 @@ case 107:
30803076
if ( ++p == pe )
30813077
goto _test_eof108;
30823078
case 108:
3083-
#line 3084 "http_parser.c"
3079+
#line 3080 "http_parser.c"
30843080
if ( (*p) < 65 ) {
30853081
if ( 48 <= (*p) && (*p) <= 57 )
30863082
goto st109;
@@ -3114,7 +3110,7 @@ case 109:
31143110
if ( ++p == pe )
31153111
goto _test_eof110;
31163112
case 110:
3117-
#line 3118 "http_parser.c"
3113+
#line 3114 "http_parser.c"
31183114
switch( (*p) ) {
31193115
case 43: goto st110;
31203116
case 58: goto st111;
@@ -3142,10 +3138,9 @@ case 110:
31423138
if ( ++p == pe )
31433139
goto _test_eof111;
31443140
case 111:
3145-
#line 3146 "http_parser.c"
3141+
#line 3142 "http_parser.c"
31463142
switch( (*p) ) {
31473143
case 32: goto tr29;
3148-
case 34: goto st0;
31493144
case 35: goto tr30;
31503145
case 37: goto st112;
31513146
case 60: goto st0;
@@ -3197,10 +3192,9 @@ case 113:
31973192
if ( ++p == pe )
31983193
goto _test_eof114;
31993194
case 114:
3200-
#line 3201 "http_parser.c"
3195+
#line 3196 "http_parser.c"
32013196
switch( (*p) ) {
32023197
case 32: goto tr135;
3203-
case 34: goto st0;
32043198
case 35: goto tr136;
32053199
case 37: goto st115;
32063200
case 60: goto st0;
@@ -3253,10 +3247,9 @@ case 116:
32533247
if ( ++p == pe )
32543248
goto _test_eof117;
32553249
case 117:
3256-
#line 3257 "http_parser.c"
3250+
#line 3251 "http_parser.c"
32573251
switch( (*p) ) {
32583252
case 32: goto tr141;
3259-
case 34: goto st0;
32603253
case 35: goto tr142;
32613254
case 37: goto tr143;
32623255
case 60: goto st0;
@@ -3277,10 +3270,9 @@ case 117:
32773270
if ( ++p == pe )
32783271
goto _test_eof118;
32793272
case 118:
3280-
#line 3281 "http_parser.c"
3273+
#line 3274 "http_parser.c"
32813274
switch( (*p) ) {
32823275
case 32: goto tr145;
3283-
case 34: goto st0;
32843276
case 35: goto tr146;
32853277
case 37: goto st119;
32863278
case 60: goto st0;
@@ -3301,7 +3293,7 @@ case 118:
33013293
if ( ++p == pe )
33023294
goto _test_eof119;
33033295
case 119:
3304-
#line 3305 "http_parser.c"
3296+
#line 3297 "http_parser.c"
33053297
if ( (*p) < 65 ) {
33063298
if ( 48 <= (*p) && (*p) <= 57 )
33073299
goto st120;
@@ -3340,7 +3332,7 @@ case 120:
33403332
if ( ++p == pe )
33413333
goto _test_eof121;
33423334
case 121:
3343-
#line 3344 "http_parser.c"
3335+
#line 3336 "http_parser.c"
33443336
if ( (*p) == 69 )
33453337
goto st122;
33463338
goto st0;
@@ -3395,7 +3387,7 @@ case 126:
33953387
if ( ++p == pe )
33963388
goto _test_eof127;
33973389
case 127:
3398-
#line 3399 "http_parser.c"
3390+
#line 3391 "http_parser.c"
33993391
if ( (*p) == 69 )
34003392
goto st128;
34013393
goto st0;
@@ -3429,7 +3421,7 @@ case 129:
34293421
if ( ++p == pe )
34303422
goto _test_eof130;
34313423
case 130:
3432-
#line 3433 "http_parser.c"
3424+
#line 3425 "http_parser.c"
34333425
if ( (*p) == 69 )
34343426
goto st131;
34353427
goto st0;
@@ -3470,7 +3462,7 @@ case 133:
34703462
if ( ++p == pe )
34713463
goto _test_eof134;
34723464
case 134:
3473-
#line 3474 "http_parser.c"
3465+
#line 3466 "http_parser.c"
34743466
if ( (*p) == 79 )
34753467
goto st135;
34763468
goto st0;
@@ -3511,7 +3503,7 @@ case 137:
35113503
if ( ++p == pe )
35123504
goto _test_eof138;
35133505
case 138:
3514-
#line 3515 "http_parser.c"
3506+
#line 3507 "http_parser.c"
35153507
switch( (*p) ) {
35163508
case 75: goto st139;
35173509
case 79: goto st143;
@@ -3582,7 +3574,7 @@ case 145:
35823574
if ( ++p == pe )
35833575
goto _test_eof146;
35843576
case 146:
3585-
#line 3586 "http_parser.c"
3577+
#line 3578 "http_parser.c"
35863578
if ( (*p) == 80 )
35873579
goto st147;
35883580
goto st0;
@@ -3644,7 +3636,7 @@ case 152:
36443636
if ( ++p == pe )
36453637
goto _test_eof153;
36463638
case 153:
3647-
#line 3648 "http_parser.c"
3639+
#line 3640 "http_parser.c"
36483640
switch( (*p) ) {
36493641
case 79: goto st154;
36503642
case 82: goto st157;
@@ -3788,7 +3780,7 @@ case 170:
37883780
if ( ++p == pe )
37893781
goto _test_eof171;
37903782
case 171:
3791-
#line 3792 "http_parser.c"
3783+
#line 3784 "http_parser.c"
37923784
if ( (*p) == 82 )
37933785
goto st172;
37943786
goto st0;
@@ -3836,7 +3828,7 @@ case 175:
38363828
if ( ++p == pe )
38373829
goto _test_eof176;
38383830
case 176:
3839-
#line 3840 "http_parser.c"
3831+
#line 3832 "http_parser.c"
38403832
if ( (*p) == 78 )
38413833
goto st177;
38423834
goto st0;
@@ -3914,7 +3906,7 @@ case 181:
39143906
if ( ++p == pe )
39153907
goto _test_eof269;
39163908
case 269:
3917-
#line 3918 "http_parser.c"
3909+
#line 3910 "http_parser.c"
39183910
if ( (*p) == 72 )
39193911
goto tr320;
39203912
goto st0;
@@ -3934,7 +3926,7 @@ case 269:
39343926
if ( ++p == pe )
39353927
goto _test_eof182;
39363928
case 182:
3937-
#line 3938 "http_parser.c"
3929+
#line 3930 "http_parser.c"
39383930
if ( (*p) == 84 )
39393931
goto st183;
39403932
goto st0;
@@ -3977,7 +3969,7 @@ case 186:
39773969
if ( ++p == pe )
39783970
goto _test_eof187;
39793971
case 187:
3980-
#line 3981 "http_parser.c"
3972+
#line 3973 "http_parser.c"
39813973
if ( (*p) == 46 )
39823974
goto st188;
39833975
goto st0;
@@ -3999,7 +3991,7 @@ case 188:
39993991
if ( ++p == pe )
40003992
goto _test_eof189;
40013993
case 189:
4002-
#line 4003 "http_parser.c"
3994+
#line 3995 "http_parser.c"
40033995
if ( (*p) == 32 )
40043996
goto st190;
40053997
goto st0;
@@ -4021,7 +4013,7 @@ case 190:
40214013
if ( ++p == pe )
40224014
goto _test_eof191;
40234015
case 191:
4024-
#line 4025 "http_parser.c"
4016+
#line 4017 "http_parser.c"
40254017
if ( 48 <= (*p) && (*p) <= 57 )
40264018
goto tr223;
40274019
goto st0;
@@ -4036,7 +4028,7 @@ case 191:
40364028
if ( ++p == pe )
40374029
goto _test_eof192;
40384030
case 192:
4039-
#line 4040 "http_parser.c"
4031+
#line 4032 "http_parser.c"
40404032
if ( 48 <= (*p) && (*p) <= 57 )
40414033
goto tr224;
40424034
goto st0;
@@ -4051,7 +4043,7 @@ case 192:
40514043
if ( ++p == pe )
40524044
goto _test_eof193;
40534045
case 193:
4054-
#line 4055 "http_parser.c"
4046+
#line 4047 "http_parser.c"
40554047
switch( (*p) ) {
40564048
case 13: goto st194;
40574049
case 32: goto st265;
@@ -4132,7 +4124,7 @@ case 193:
41324124
if ( ++p == pe )
41334125
goto _test_eof194;
41344126
case 194:
4135-
#line 4136 "http_parser.c"
4127+
#line 4128 "http_parser.c"
41364128
if ( (*p) == 10 )
41374129
goto st195;
41384130
goto st0;
@@ -4186,7 +4178,7 @@ case 196:
41864178
if ( ++p == pe )
41874179
goto _test_eof197;
41884180
case 197:
4189-
#line 4190 "http_parser.c"
4181+
#line 4182 "http_parser.c"
41904182
switch( (*p) ) {
41914183
case 33: goto st197;
41924184
case 58: goto tr234;
@@ -4227,7 +4219,7 @@ case 197:
42274219
if ( ++p == pe )
42284220
goto _test_eof198;
42294221
case 198:
4230-
#line 4231 "http_parser.c"
4222+
#line 4223 "http_parser.c"
42314223
switch( (*p) ) {
42324224
case 13: goto tr236;
42334225
case 32: goto st198;
@@ -4244,7 +4236,7 @@ case 198:
42444236
if ( ++p == pe )
42454237
goto _test_eof199;
42464238
case 199:
4247-
#line 4248 "http_parser.c"
4239+
#line 4240 "http_parser.c"
42484240
if ( (*p) == 13 )
42494241
goto tr239;
42504242
goto st199;
@@ -4259,7 +4251,7 @@ case 199:
42594251
if ( ++p == pe )
42604252
goto _test_eof200;
42614253
case 200:
4262-
#line 4263 "http_parser.c"
4254+
#line 4255 "http_parser.c"
42634255
switch( (*p) ) {
42644256
case 33: goto st197;
42654257
case 58: goto tr234;
@@ -4572,7 +4564,7 @@ case 209:
45724564
if ( ++p == pe )
45734565
goto _test_eof210;
45744566
case 210:
4575-
#line 4576 "http_parser.c"
4567+
#line 4568 "http_parser.c"
45764568
switch( (*p) ) {
45774569
case 13: goto tr236;
45784570
case 32: goto st210;
@@ -4593,7 +4585,7 @@ case 210:
45934585
if ( ++p == pe )
45944586
goto _test_eof211;
45954587
case 211:
4596-
#line 4597 "http_parser.c"
4588+
#line 4589 "http_parser.c"
45974589
switch( (*p) ) {
45984590
case 13: goto tr239;
45994591
case 76: goto st212;
@@ -4648,7 +4640,7 @@ case 215:
46484640
if ( ++p == pe )
46494641
goto _test_eof216;
46504642
case 216:
4651-
#line 4652 "http_parser.c"
4643+
#line 4644 "http_parser.c"
46524644
switch( (*p) ) {
46534645
case 13: goto tr239;
46544646
case 69: goto st217;
@@ -5082,7 +5074,7 @@ case 236:
50825074
if ( ++p == pe )
50835075
goto _test_eof237;
50845076
case 237:
5085-
#line 5086 "http_parser.c"
5077+
#line 5078 "http_parser.c"
50865078
switch( (*p) ) {
50875079
case 13: goto tr236;
50885080
case 32: goto st237;
@@ -5121,7 +5113,7 @@ case 237:
51215113
if ( ++p == pe )
51225114
goto _test_eof238;
51235115
case 238:
5124-
#line 5125 "http_parser.c"
5116+
#line 5117 "http_parser.c"
51255117
if ( (*p) == 13 )
51265118
goto tr239;
51275119
if ( 48 <= (*p) && (*p) <= 57 )
@@ -5138,7 +5130,7 @@ case 238:
51385130
if ( ++p == pe )
51395131
goto _test_eof239;
51405132
case 239:
5141-
#line 5142 "http_parser.c"
5133+
#line 5134 "http_parser.c"
51425134
switch( (*p) ) {
51435135
case 33: goto st197;
51445136
case 58: goto tr234;
@@ -5658,7 +5650,7 @@ case 255:
56585650
if ( ++p == pe )
56595651
goto _test_eof256;
56605652
case 256:
5661-
#line 5662 "http_parser.c"
5653+
#line 5654 "http_parser.c"
56625654
switch( (*p) ) {
56635655
case 13: goto tr236;
56645656
case 32: goto st256;
@@ -5676,7 +5668,7 @@ case 256:
56765668
if ( ++p == pe )
56775669
goto _test_eof257;
56785670
case 257:
5679-
#line 5680 "http_parser.c"
5671+
#line 5672 "http_parser.c"
56805672
switch( (*p) ) {
56815673
case 13: goto tr239;
56825674
case 100: goto st258;

deps/http_parser/http_parser.rl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ do { \
312312
national = any -- (alpha | digit | reserved | extra | safe | unsafe);
313313
unreserved = (alpha | digit | safe | extra | national);
314314
escape = ("%" xdigit xdigit);
315-
uchar = (unreserved | escape);
315+
uchar = (unreserved | escape | "\"");
316316
pchar = (uchar | ":" | "@" | "&" | "=" | "+");
317317
tspecials = ("(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\\" | "\""
318318
| "/" | "[" | "]" | "?" | "=" | "{" | "}" | " " | "\t");

0 commit comments

Comments
 (0)