rev 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +16 -0
- data/README +1 -0
- data/Rakefile +10 -0
- data/ext/http11_client/http11_parser.c +563 -502
- data/ext/http11_client/http11_parser.rl +1 -1
- data/ext/libev/Changes +39 -1
- data/ext/libev/ev.c +286 -105
- data/ext/libev/ev.h +102 -34
- data/ext/libev/ev_poll.c +17 -14
- data/ext/libev/ev_select.c +4 -4
- data/ext/libev/ev_vars.h +14 -1
- data/ext/libev/ev_wrap.h +14 -0
- data/ext/rev/extconf.rb +15 -11
- data/ext/rev/rev_loop.c +35 -34
- data/ext/rev/rev_ssl.c +90 -3
- data/lib/rev.rb +8 -2
- data/lib/rev/http_client.rb +6 -6
- data/lib/rev/io.rb +53 -29
- data/lib/rev/io_watcher.rb +2 -1
- data/lib/rev/{watcher.rb → meta.rb} +3 -3
- data/lib/rev/server.rb +2 -2
- data/lib/rev/socket.rb +27 -21
- data/lib/rev/ssl.rb +35 -49
- data/lib/rev/timer_watcher.rb +1 -0
- data/rev.gemspec +2 -2
- metadata +3 -3
data/CHANGES
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
0.2.1:
|
2
|
+
|
3
|
+
* Upgrade to libev 3.31
|
4
|
+
|
5
|
+
* Rev::Loop#run_once and Rev::Loop#run_nonblock now return the number of events
|
6
|
+
received when they were running.
|
7
|
+
|
8
|
+
* Remove inheritence relationship between Rev::IO and Rev::IOWatcher
|
9
|
+
|
10
|
+
* Loosen HTTP/1.1 response parser to accept a common malformation in HTTP/1.1
|
11
|
+
chunk headers
|
12
|
+
|
13
|
+
* Add underscore prefix to instance variables to avoid conflicts in subclasses
|
14
|
+
|
15
|
+
* Remove Rev::SSLServer until it can be made more useful
|
16
|
+
|
1
17
|
0.2.0:
|
2
18
|
|
3
19
|
* Initial Ruby 1.8.6 support
|
data/README
CHANGED
data/Rakefile
CHANGED
@@ -20,6 +20,16 @@ Rake::RDocTask.new(:rdoc) do |task|
|
|
20
20
|
task.rdoc_files.include(['README', 'LICENSE'])
|
21
21
|
end
|
22
22
|
|
23
|
+
# Rebuild parser Ragel
|
24
|
+
task :ragel do
|
25
|
+
Dir.chdir "ext/http11_client" do
|
26
|
+
target = "http11_parser.c"
|
27
|
+
File.unlink target if File.exist? target
|
28
|
+
sh "ragel http11_parser.rl | rlgen-cd -G2 -o #{target}"
|
29
|
+
raise "Failed to build C source" unless File.exist? target
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
23
33
|
# Gem
|
24
34
|
Rake::GemPackageTask.new(GEMSPEC) do |pkg|
|
25
35
|
pkg.need_tar = true
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#line 1 "
|
1
|
+
#line 1 "http11_parser.rl"
|
2
2
|
/**
|
3
3
|
* Copyright (c) 2005 Zed A. Shaw
|
4
4
|
* You can redistribute it and/or modify it under the same terms as Ruby.
|
@@ -18,28 +18,28 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
/** machine **/
|
21
|
-
#line 95 "
|
21
|
+
#line 95 "http11_parser.rl"
|
22
22
|
|
23
23
|
|
24
24
|
/** Data **/
|
25
25
|
|
26
|
-
#line 27 "
|
27
|
-
static const int httpclient_parser_start =
|
26
|
+
#line 27 "http11_parser.c"
|
27
|
+
static const int httpclient_parser_start = 1;
|
28
|
+
static const int httpclient_parser_first_final = 37;
|
29
|
+
static const int httpclient_parser_error = 0;
|
28
30
|
|
29
|
-
static const int
|
31
|
+
static const int httpclient_parser_en_main = 1;
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
#line 99 "ext/http11_client/http11_parser.rl"
|
33
|
+
#line 99 "http11_parser.rl"
|
34
34
|
|
35
35
|
int httpclient_parser_init(httpclient_parser *parser) {
|
36
36
|
int cs = 0;
|
37
37
|
|
38
|
-
#line 39 "
|
38
|
+
#line 39 "http11_parser.c"
|
39
39
|
{
|
40
40
|
cs = httpclient_parser_start;
|
41
41
|
}
|
42
|
-
#line 103 "
|
42
|
+
#line 103 "http11_parser.rl"
|
43
43
|
parser->cs = cs;
|
44
44
|
parser->body_start = 0;
|
45
45
|
parser->content_len = 0;
|
@@ -67,44 +67,44 @@ size_t httpclient_parser_execute(httpclient_parser *parser, const char *buffer,
|
|
67
67
|
|
68
68
|
|
69
69
|
|
70
|
-
#line 71 "
|
70
|
+
#line 71 "http11_parser.c"
|
71
71
|
{
|
72
72
|
if ( p == pe )
|
73
73
|
goto _out;
|
74
74
|
switch ( cs )
|
75
75
|
{
|
76
|
-
case
|
76
|
+
case 1:
|
77
77
|
switch( (*p) ) {
|
78
78
|
case 13: goto st2;
|
79
|
-
case 48: goto
|
80
|
-
case 59: goto
|
81
|
-
case 72: goto
|
79
|
+
case 48: goto tr2;
|
80
|
+
case 59: goto st16;
|
81
|
+
case 72: goto tr5;
|
82
82
|
}
|
83
83
|
if ( (*p) < 65 ) {
|
84
84
|
if ( 49 <= (*p) && (*p) <= 57 )
|
85
|
-
goto
|
85
|
+
goto tr3;
|
86
86
|
} else if ( (*p) > 70 ) {
|
87
87
|
if ( 97 <= (*p) && (*p) <= 102 )
|
88
|
-
goto
|
88
|
+
goto tr3;
|
89
89
|
} else
|
90
|
-
goto
|
91
|
-
goto
|
92
|
-
|
93
|
-
goto
|
94
|
-
|
95
|
-
#line
|
96
|
-
{
|
97
|
-
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
98
|
-
}
|
99
|
-
goto st2;
|
100
|
-
tr52:
|
101
|
-
#line 27 "ext/http11_client/http11_parser.rl"
|
90
|
+
goto tr3;
|
91
|
+
goto st0;
|
92
|
+
st0:
|
93
|
+
goto _out0;
|
94
|
+
tr38:
|
95
|
+
#line 27 "http11_parser.rl"
|
102
96
|
{
|
103
97
|
parser->field_len = LEN(field_start, p);
|
104
98
|
}
|
105
|
-
#line 31 "
|
99
|
+
#line 31 "http11_parser.rl"
|
106
100
|
{ MARK(mark, p); }
|
107
|
-
#line 33 "
|
101
|
+
#line 33 "http11_parser.rl"
|
102
|
+
{
|
103
|
+
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
104
|
+
}
|
105
|
+
goto st2;
|
106
|
+
tr43:
|
107
|
+
#line 33 "http11_parser.rl"
|
108
108
|
{
|
109
109
|
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
110
110
|
}
|
@@ -113,93 +113,97 @@ st2:
|
|
113
113
|
if ( ++p == pe )
|
114
114
|
goto _out2;
|
115
115
|
case 2:
|
116
|
-
#line 117 "
|
116
|
+
#line 117 "http11_parser.c"
|
117
117
|
if ( (*p) == 10 )
|
118
|
-
goto
|
119
|
-
goto
|
120
|
-
|
121
|
-
#line
|
118
|
+
goto tr6;
|
119
|
+
goto st0;
|
120
|
+
tr6:
|
121
|
+
#line 53 "http11_parser.rl"
|
122
|
+
{
|
123
|
+
parser->last_chunk(parser->data, NULL, 0);
|
124
|
+
}
|
125
|
+
#line 57 "http11_parser.rl"
|
122
126
|
{
|
123
127
|
parser->body_start = p - buffer + 1;
|
124
128
|
if(parser->header_done != NULL)
|
125
129
|
parser->header_done(parser->data, p + 1, pe - p - 1);
|
126
|
-
goto
|
127
|
-
}
|
128
|
-
goto st36;
|
129
|
-
tr34:
|
130
|
-
#line 53 "ext/http11_client/http11_parser.rl"
|
131
|
-
{
|
132
|
-
parser->last_chunk(parser->data, NULL, 0);
|
130
|
+
goto _out37;
|
133
131
|
}
|
134
|
-
|
132
|
+
goto st37;
|
133
|
+
tr13:
|
134
|
+
#line 57 "http11_parser.rl"
|
135
135
|
{
|
136
136
|
parser->body_start = p - buffer + 1;
|
137
137
|
if(parser->header_done != NULL)
|
138
138
|
parser->header_done(parser->data, p + 1, pe - p - 1);
|
139
|
-
goto
|
139
|
+
goto _out37;
|
140
140
|
}
|
141
|
-
goto
|
142
|
-
|
143
|
-
#line 57 "
|
141
|
+
goto st37;
|
142
|
+
tr14:
|
143
|
+
#line 57 "http11_parser.rl"
|
144
144
|
{
|
145
145
|
parser->body_start = p - buffer + 1;
|
146
146
|
if(parser->header_done != NULL)
|
147
147
|
parser->header_done(parser->data, p + 1, pe - p - 1);
|
148
|
-
goto
|
148
|
+
goto _out37;
|
149
149
|
}
|
150
|
-
#line 53 "
|
150
|
+
#line 53 "http11_parser.rl"
|
151
151
|
{
|
152
152
|
parser->last_chunk(parser->data, NULL, 0);
|
153
153
|
}
|
154
|
-
goto
|
155
|
-
|
154
|
+
goto st37;
|
155
|
+
st37:
|
156
156
|
if ( ++p == pe )
|
157
|
-
goto
|
158
|
-
case
|
159
|
-
#line 160 "
|
160
|
-
goto
|
161
|
-
|
162
|
-
#line 23 "
|
157
|
+
goto _out37;
|
158
|
+
case 37:
|
159
|
+
#line 160 "http11_parser.c"
|
160
|
+
goto st0;
|
161
|
+
tr2:
|
162
|
+
#line 23 "http11_parser.rl"
|
163
163
|
{MARK(mark, p); }
|
164
164
|
goto st3;
|
165
165
|
st3:
|
166
166
|
if ( ++p == pe )
|
167
167
|
goto _out3;
|
168
168
|
case 3:
|
169
|
-
#line 170 "
|
169
|
+
#line 170 "http11_parser.c"
|
170
170
|
switch( (*p) ) {
|
171
|
-
case 13: goto
|
172
|
-
case
|
171
|
+
case 13: goto tr8;
|
172
|
+
case 32: goto tr7;
|
173
|
+
case 59: goto tr10;
|
173
174
|
}
|
174
|
-
if ( (*p) <
|
175
|
-
if (
|
176
|
-
goto
|
177
|
-
} else if ( (*p) >
|
178
|
-
if (
|
179
|
-
|
175
|
+
if ( (*p) < 48 ) {
|
176
|
+
if ( 9 <= (*p) && (*p) <= 12 )
|
177
|
+
goto tr7;
|
178
|
+
} else if ( (*p) > 57 ) {
|
179
|
+
if ( (*p) > 70 ) {
|
180
|
+
if ( 97 <= (*p) && (*p) <= 102 )
|
181
|
+
goto st7;
|
182
|
+
} else if ( (*p) >= 65 )
|
183
|
+
goto st7;
|
180
184
|
} else
|
181
|
-
goto
|
182
|
-
goto
|
183
|
-
|
184
|
-
#line
|
185
|
-
{
|
186
|
-
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
187
|
-
}
|
188
|
-
goto st4;
|
189
|
-
tr50:
|
190
|
-
#line 49 "ext/http11_client/http11_parser.rl"
|
185
|
+
goto st7;
|
186
|
+
goto st0;
|
187
|
+
tr7:
|
188
|
+
#line 49 "http11_parser.rl"
|
191
189
|
{
|
192
190
|
parser->chunk_size(parser->data, PTR_TO(mark), LEN(mark, p));
|
193
191
|
}
|
194
192
|
goto st4;
|
195
|
-
|
196
|
-
#line 27 "
|
193
|
+
tr18:
|
194
|
+
#line 27 "http11_parser.rl"
|
197
195
|
{
|
198
196
|
parser->field_len = LEN(field_start, p);
|
199
197
|
}
|
200
|
-
#line 31 "
|
198
|
+
#line 31 "http11_parser.rl"
|
201
199
|
{ MARK(mark, p); }
|
202
|
-
#line 33 "
|
200
|
+
#line 33 "http11_parser.rl"
|
201
|
+
{
|
202
|
+
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
203
|
+
}
|
204
|
+
goto st4;
|
205
|
+
tr24:
|
206
|
+
#line 33 "http11_parser.rl"
|
203
207
|
{
|
204
208
|
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
205
209
|
}
|
@@ -208,52 +212,66 @@ st4:
|
|
208
212
|
if ( ++p == pe )
|
209
213
|
goto _out4;
|
210
214
|
case 4:
|
211
|
-
#line
|
212
|
-
if ( (*p) == 10 )
|
213
|
-
goto tr35;
|
214
|
-
goto st1;
|
215
|
-
tr17:
|
216
|
-
#line 23 "ext/http11_client/http11_parser.rl"
|
217
|
-
{MARK(mark, p); }
|
218
|
-
goto st5;
|
219
|
-
st5:
|
220
|
-
if ( ++p == pe )
|
221
|
-
goto _out5;
|
222
|
-
case 5:
|
223
|
-
#line 224 "ext/http11_client/http11_parser.c"
|
215
|
+
#line 216 "http11_parser.c"
|
224
216
|
switch( (*p) ) {
|
225
|
-
case 13: goto
|
226
|
-
case
|
217
|
+
case 13: goto st5;
|
218
|
+
case 32: goto st4;
|
227
219
|
}
|
228
|
-
if ( (*p)
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
goto
|
237
|
-
|
238
|
-
#line
|
220
|
+
if ( 9 <= (*p) && (*p) <= 12 )
|
221
|
+
goto st4;
|
222
|
+
goto st0;
|
223
|
+
tr15:
|
224
|
+
#line 49 "http11_parser.rl"
|
225
|
+
{
|
226
|
+
parser->chunk_size(parser->data, PTR_TO(mark), LEN(mark, p));
|
227
|
+
}
|
228
|
+
goto st5;
|
229
|
+
tr19:
|
230
|
+
#line 27 "http11_parser.rl"
|
231
|
+
{
|
232
|
+
parser->field_len = LEN(field_start, p);
|
233
|
+
}
|
234
|
+
#line 31 "http11_parser.rl"
|
235
|
+
{ MARK(mark, p); }
|
236
|
+
#line 33 "http11_parser.rl"
|
239
237
|
{
|
240
238
|
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
241
239
|
}
|
242
|
-
goto
|
240
|
+
goto st5;
|
243
241
|
tr25:
|
244
|
-
#line
|
242
|
+
#line 33 "http11_parser.rl"
|
243
|
+
{
|
244
|
+
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
245
|
+
}
|
246
|
+
goto st5;
|
247
|
+
st5:
|
248
|
+
if ( ++p == pe )
|
249
|
+
goto _out5;
|
250
|
+
case 5:
|
251
|
+
#line 252 "http11_parser.c"
|
252
|
+
if ( (*p) == 10 )
|
253
|
+
goto tr13;
|
254
|
+
goto st0;
|
255
|
+
tr8:
|
256
|
+
#line 49 "http11_parser.rl"
|
245
257
|
{
|
246
258
|
parser->chunk_size(parser->data, PTR_TO(mark), LEN(mark, p));
|
247
259
|
}
|
248
260
|
goto st6;
|
249
|
-
|
250
|
-
#line 27 "
|
261
|
+
tr29:
|
262
|
+
#line 27 "http11_parser.rl"
|
251
263
|
{
|
252
264
|
parser->field_len = LEN(field_start, p);
|
253
265
|
}
|
254
|
-
#line 31 "
|
266
|
+
#line 31 "http11_parser.rl"
|
255
267
|
{ MARK(mark, p); }
|
256
|
-
#line 33 "
|
268
|
+
#line 33 "http11_parser.rl"
|
269
|
+
{
|
270
|
+
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
271
|
+
}
|
272
|
+
goto st6;
|
273
|
+
tr34:
|
274
|
+
#line 33 "http11_parser.rl"
|
257
275
|
{
|
258
276
|
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
259
277
|
}
|
@@ -262,709 +280,751 @@ st6:
|
|
262
280
|
if ( ++p == pe )
|
263
281
|
goto _out6;
|
264
282
|
case 6:
|
265
|
-
#line
|
283
|
+
#line 284 "http11_parser.c"
|
266
284
|
if ( (*p) == 10 )
|
267
|
-
goto
|
268
|
-
goto
|
269
|
-
|
270
|
-
#line
|
271
|
-
{
|
272
|
-
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
273
|
-
}
|
285
|
+
goto tr14;
|
286
|
+
goto st0;
|
287
|
+
tr3:
|
288
|
+
#line 23 "http11_parser.rl"
|
289
|
+
{MARK(mark, p); }
|
274
290
|
goto st7;
|
275
|
-
|
276
|
-
|
291
|
+
st7:
|
292
|
+
if ( ++p == pe )
|
293
|
+
goto _out7;
|
294
|
+
case 7:
|
295
|
+
#line 296 "http11_parser.c"
|
296
|
+
switch( (*p) ) {
|
297
|
+
case 13: goto tr15;
|
298
|
+
case 32: goto tr7;
|
299
|
+
case 59: goto tr16;
|
300
|
+
}
|
301
|
+
if ( (*p) < 48 ) {
|
302
|
+
if ( 9 <= (*p) && (*p) <= 12 )
|
303
|
+
goto tr7;
|
304
|
+
} else if ( (*p) > 57 ) {
|
305
|
+
if ( (*p) > 70 ) {
|
306
|
+
if ( 97 <= (*p) && (*p) <= 102 )
|
307
|
+
goto st7;
|
308
|
+
} else if ( (*p) >= 65 )
|
309
|
+
goto st7;
|
310
|
+
} else
|
311
|
+
goto st7;
|
312
|
+
goto st0;
|
313
|
+
tr16:
|
314
|
+
#line 49 "http11_parser.rl"
|
277
315
|
{
|
278
316
|
parser->chunk_size(parser->data, PTR_TO(mark), LEN(mark, p));
|
279
317
|
}
|
280
|
-
goto
|
281
|
-
|
282
|
-
#line 27 "
|
318
|
+
goto st8;
|
319
|
+
tr21:
|
320
|
+
#line 27 "http11_parser.rl"
|
283
321
|
{
|
284
322
|
parser->field_len = LEN(field_start, p);
|
285
323
|
}
|
286
|
-
#line 31 "
|
324
|
+
#line 31 "http11_parser.rl"
|
287
325
|
{ MARK(mark, p); }
|
288
|
-
#line 33 "
|
326
|
+
#line 33 "http11_parser.rl"
|
327
|
+
{
|
328
|
+
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
329
|
+
}
|
330
|
+
goto st8;
|
331
|
+
tr27:
|
332
|
+
#line 33 "http11_parser.rl"
|
289
333
|
{
|
290
334
|
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
291
335
|
}
|
292
|
-
goto st7;
|
293
|
-
st7:
|
294
|
-
if ( ++p == pe )
|
295
|
-
goto _out7;
|
296
|
-
case 7:
|
297
|
-
#line 298 "ext/http11_client/http11_parser.c"
|
298
|
-
switch( (*p) ) {
|
299
|
-
case 33: goto tr9;
|
300
|
-
case 124: goto tr9;
|
301
|
-
case 126: goto tr9;
|
302
|
-
}
|
303
|
-
if ( (*p) < 45 ) {
|
304
|
-
if ( (*p) > 39 ) {
|
305
|
-
if ( 42 <= (*p) && (*p) <= 43 )
|
306
|
-
goto tr9;
|
307
|
-
} else if ( (*p) >= 35 )
|
308
|
-
goto tr9;
|
309
|
-
} else if ( (*p) > 46 ) {
|
310
|
-
if ( (*p) < 65 ) {
|
311
|
-
if ( 48 <= (*p) && (*p) <= 57 )
|
312
|
-
goto tr9;
|
313
|
-
} else if ( (*p) > 90 ) {
|
314
|
-
if ( 94 <= (*p) && (*p) <= 122 )
|
315
|
-
goto tr9;
|
316
|
-
} else
|
317
|
-
goto tr9;
|
318
|
-
} else
|
319
|
-
goto tr9;
|
320
|
-
goto st1;
|
321
|
-
tr9:
|
322
|
-
#line 25 "ext/http11_client/http11_parser.rl"
|
323
|
-
{ MARK(field_start, p); }
|
324
336
|
goto st8;
|
325
337
|
st8:
|
326
338
|
if ( ++p == pe )
|
327
339
|
goto _out8;
|
328
340
|
case 8:
|
329
|
-
#line
|
341
|
+
#line 342 "http11_parser.c"
|
330
342
|
switch( (*p) ) {
|
331
|
-
case
|
332
|
-
case
|
333
|
-
case
|
334
|
-
case 61: goto tr31;
|
335
|
-
case 124: goto st8;
|
336
|
-
case 126: goto st8;
|
343
|
+
case 33: goto tr17;
|
344
|
+
case 124: goto tr17;
|
345
|
+
case 126: goto tr17;
|
337
346
|
}
|
338
347
|
if ( (*p) < 45 ) {
|
339
348
|
if ( (*p) > 39 ) {
|
340
349
|
if ( 42 <= (*p) && (*p) <= 43 )
|
341
|
-
goto
|
350
|
+
goto tr17;
|
342
351
|
} else if ( (*p) >= 35 )
|
343
|
-
goto
|
352
|
+
goto tr17;
|
344
353
|
} else if ( (*p) > 46 ) {
|
345
354
|
if ( (*p) < 65 ) {
|
346
355
|
if ( 48 <= (*p) && (*p) <= 57 )
|
347
|
-
goto
|
356
|
+
goto tr17;
|
348
357
|
} else if ( (*p) > 90 ) {
|
349
358
|
if ( 94 <= (*p) && (*p) <= 122 )
|
350
|
-
goto
|
359
|
+
goto tr17;
|
351
360
|
} else
|
352
|
-
goto
|
361
|
+
goto tr17;
|
353
362
|
} else
|
354
|
-
goto
|
355
|
-
goto
|
356
|
-
|
357
|
-
#line
|
358
|
-
{
|
359
|
-
parser->field_len = LEN(field_start, p);
|
360
|
-
}
|
361
|
-
#line 31 "ext/http11_client/http11_parser.rl"
|
362
|
-
{ MARK(mark, p); }
|
363
|
+
goto tr17;
|
364
|
+
goto st0;
|
365
|
+
tr17:
|
366
|
+
#line 25 "http11_parser.rl"
|
367
|
+
{ MARK(field_start, p); }
|
363
368
|
goto st9;
|
364
369
|
st9:
|
365
370
|
if ( ++p == pe )
|
366
371
|
goto _out9;
|
367
372
|
case 9:
|
368
|
-
#line
|
373
|
+
#line 374 "http11_parser.c"
|
369
374
|
switch( (*p) ) {
|
370
|
-
case
|
371
|
-
case
|
372
|
-
case
|
375
|
+
case 13: goto tr19;
|
376
|
+
case 32: goto tr18;
|
377
|
+
case 33: goto st9;
|
378
|
+
case 59: goto tr21;
|
379
|
+
case 61: goto tr22;
|
380
|
+
case 124: goto st9;
|
381
|
+
case 126: goto st9;
|
373
382
|
}
|
374
383
|
if ( (*p) < 45 ) {
|
375
|
-
if ( (*p)
|
384
|
+
if ( (*p) < 35 ) {
|
385
|
+
if ( 9 <= (*p) && (*p) <= 12 )
|
386
|
+
goto tr18;
|
387
|
+
} else if ( (*p) > 39 ) {
|
376
388
|
if ( 42 <= (*p) && (*p) <= 43 )
|
377
|
-
goto
|
378
|
-
} else
|
379
|
-
goto
|
389
|
+
goto st9;
|
390
|
+
} else
|
391
|
+
goto st9;
|
380
392
|
} else if ( (*p) > 46 ) {
|
381
393
|
if ( (*p) < 65 ) {
|
382
394
|
if ( 48 <= (*p) && (*p) <= 57 )
|
383
|
-
goto
|
395
|
+
goto st9;
|
384
396
|
} else if ( (*p) > 90 ) {
|
385
397
|
if ( 94 <= (*p) && (*p) <= 122 )
|
386
|
-
goto
|
398
|
+
goto st9;
|
387
399
|
} else
|
388
|
-
goto
|
400
|
+
goto st9;
|
389
401
|
} else
|
390
|
-
goto
|
391
|
-
goto
|
392
|
-
|
393
|
-
#line
|
402
|
+
goto st9;
|
403
|
+
goto st0;
|
404
|
+
tr22:
|
405
|
+
#line 27 "http11_parser.rl"
|
406
|
+
{
|
407
|
+
parser->field_len = LEN(field_start, p);
|
408
|
+
}
|
409
|
+
#line 31 "http11_parser.rl"
|
394
410
|
{ MARK(mark, p); }
|
395
411
|
goto st10;
|
396
412
|
st10:
|
397
413
|
if ( ++p == pe )
|
398
414
|
goto _out10;
|
399
415
|
case 10:
|
400
|
-
#line
|
416
|
+
#line 417 "http11_parser.c"
|
401
417
|
switch( (*p) ) {
|
402
|
-
case
|
403
|
-
case
|
404
|
-
case
|
405
|
-
case 124: goto st10;
|
406
|
-
case 126: goto st10;
|
418
|
+
case 33: goto tr23;
|
419
|
+
case 124: goto tr23;
|
420
|
+
case 126: goto tr23;
|
407
421
|
}
|
408
422
|
if ( (*p) < 45 ) {
|
409
423
|
if ( (*p) > 39 ) {
|
410
424
|
if ( 42 <= (*p) && (*p) <= 43 )
|
411
|
-
goto
|
425
|
+
goto tr23;
|
412
426
|
} else if ( (*p) >= 35 )
|
413
|
-
goto
|
427
|
+
goto tr23;
|
414
428
|
} else if ( (*p) > 46 ) {
|
415
429
|
if ( (*p) < 65 ) {
|
416
430
|
if ( 48 <= (*p) && (*p) <= 57 )
|
417
|
-
goto
|
431
|
+
goto tr23;
|
418
432
|
} else if ( (*p) > 90 ) {
|
419
433
|
if ( 94 <= (*p) && (*p) <= 122 )
|
420
|
-
goto
|
434
|
+
goto tr23;
|
421
435
|
} else
|
422
|
-
goto
|
436
|
+
goto tr23;
|
423
437
|
} else
|
424
|
-
goto
|
425
|
-
goto
|
426
|
-
|
427
|
-
#line
|
428
|
-
{
|
429
|
-
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
430
|
-
}
|
431
|
-
goto st11;
|
432
|
-
tr51:
|
433
|
-
#line 49 "ext/http11_client/http11_parser.rl"
|
434
|
-
{
|
435
|
-
parser->chunk_size(parser->data, PTR_TO(mark), LEN(mark, p));
|
436
|
-
}
|
437
|
-
goto st11;
|
438
|
-
tr58:
|
439
|
-
#line 27 "ext/http11_client/http11_parser.rl"
|
440
|
-
{
|
441
|
-
parser->field_len = LEN(field_start, p);
|
442
|
-
}
|
443
|
-
#line 31 "ext/http11_client/http11_parser.rl"
|
438
|
+
goto tr23;
|
439
|
+
goto st0;
|
440
|
+
tr23:
|
441
|
+
#line 31 "http11_parser.rl"
|
444
442
|
{ MARK(mark, p); }
|
445
|
-
#line 33 "ext/http11_client/http11_parser.rl"
|
446
|
-
{
|
447
|
-
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
448
|
-
}
|
449
443
|
goto st11;
|
450
444
|
st11:
|
451
445
|
if ( ++p == pe )
|
452
446
|
goto _out11;
|
453
447
|
case 11:
|
454
|
-
#line
|
448
|
+
#line 449 "http11_parser.c"
|
455
449
|
switch( (*p) ) {
|
456
|
-
case
|
457
|
-
case
|
458
|
-
case
|
450
|
+
case 13: goto tr25;
|
451
|
+
case 32: goto tr24;
|
452
|
+
case 33: goto st11;
|
453
|
+
case 59: goto tr27;
|
454
|
+
case 124: goto st11;
|
455
|
+
case 126: goto st11;
|
459
456
|
}
|
460
457
|
if ( (*p) < 45 ) {
|
461
|
-
if ( (*p)
|
458
|
+
if ( (*p) < 35 ) {
|
459
|
+
if ( 9 <= (*p) && (*p) <= 12 )
|
460
|
+
goto tr24;
|
461
|
+
} else if ( (*p) > 39 ) {
|
462
462
|
if ( 42 <= (*p) && (*p) <= 43 )
|
463
|
-
goto
|
464
|
-
} else
|
465
|
-
goto
|
463
|
+
goto st11;
|
464
|
+
} else
|
465
|
+
goto st11;
|
466
466
|
} else if ( (*p) > 46 ) {
|
467
467
|
if ( (*p) < 65 ) {
|
468
468
|
if ( 48 <= (*p) && (*p) <= 57 )
|
469
|
-
goto
|
469
|
+
goto st11;
|
470
470
|
} else if ( (*p) > 90 ) {
|
471
471
|
if ( 94 <= (*p) && (*p) <= 122 )
|
472
|
-
goto
|
472
|
+
goto st11;
|
473
473
|
} else
|
474
|
-
goto
|
474
|
+
goto st11;
|
475
475
|
} else
|
476
|
-
goto
|
477
|
-
goto
|
478
|
-
|
479
|
-
#line
|
480
|
-
{
|
476
|
+
goto st11;
|
477
|
+
goto st0;
|
478
|
+
tr10:
|
479
|
+
#line 49 "http11_parser.rl"
|
480
|
+
{
|
481
|
+
parser->chunk_size(parser->data, PTR_TO(mark), LEN(mark, p));
|
482
|
+
}
|
483
|
+
goto st12;
|
484
|
+
tr31:
|
485
|
+
#line 27 "http11_parser.rl"
|
486
|
+
{
|
487
|
+
parser->field_len = LEN(field_start, p);
|
488
|
+
}
|
489
|
+
#line 31 "http11_parser.rl"
|
490
|
+
{ MARK(mark, p); }
|
491
|
+
#line 33 "http11_parser.rl"
|
492
|
+
{
|
493
|
+
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
494
|
+
}
|
495
|
+
goto st12;
|
496
|
+
tr36:
|
497
|
+
#line 33 "http11_parser.rl"
|
498
|
+
{
|
499
|
+
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
500
|
+
}
|
481
501
|
goto st12;
|
482
502
|
st12:
|
483
503
|
if ( ++p == pe )
|
484
504
|
goto _out12;
|
485
505
|
case 12:
|
486
|
-
#line
|
506
|
+
#line 507 "http11_parser.c"
|
487
507
|
switch( (*p) ) {
|
488
|
-
case
|
489
|
-
case
|
490
|
-
case
|
491
|
-
case 61: goto tr59;
|
492
|
-
case 124: goto st12;
|
493
|
-
case 126: goto st12;
|
508
|
+
case 33: goto tr28;
|
509
|
+
case 124: goto tr28;
|
510
|
+
case 126: goto tr28;
|
494
511
|
}
|
495
512
|
if ( (*p) < 45 ) {
|
496
513
|
if ( (*p) > 39 ) {
|
497
514
|
if ( 42 <= (*p) && (*p) <= 43 )
|
498
|
-
goto
|
515
|
+
goto tr28;
|
499
516
|
} else if ( (*p) >= 35 )
|
500
|
-
goto
|
517
|
+
goto tr28;
|
501
518
|
} else if ( (*p) > 46 ) {
|
502
519
|
if ( (*p) < 65 ) {
|
503
520
|
if ( 48 <= (*p) && (*p) <= 57 )
|
504
|
-
goto
|
521
|
+
goto tr28;
|
505
522
|
} else if ( (*p) > 90 ) {
|
506
523
|
if ( 94 <= (*p) && (*p) <= 122 )
|
507
|
-
goto
|
524
|
+
goto tr28;
|
508
525
|
} else
|
509
|
-
goto
|
526
|
+
goto tr28;
|
510
527
|
} else
|
511
|
-
goto
|
512
|
-
goto
|
513
|
-
|
514
|
-
#line
|
515
|
-
{
|
516
|
-
parser->field_len = LEN(field_start, p);
|
517
|
-
}
|
518
|
-
#line 31 "ext/http11_client/http11_parser.rl"
|
519
|
-
{ MARK(mark, p); }
|
528
|
+
goto tr28;
|
529
|
+
goto st0;
|
530
|
+
tr28:
|
531
|
+
#line 25 "http11_parser.rl"
|
532
|
+
{ MARK(field_start, p); }
|
520
533
|
goto st13;
|
521
534
|
st13:
|
522
535
|
if ( ++p == pe )
|
523
536
|
goto _out13;
|
524
537
|
case 13:
|
525
|
-
#line
|
538
|
+
#line 539 "http11_parser.c"
|
526
539
|
switch( (*p) ) {
|
527
|
-
case
|
528
|
-
case
|
529
|
-
case
|
540
|
+
case 13: goto tr29;
|
541
|
+
case 32: goto tr18;
|
542
|
+
case 33: goto st13;
|
543
|
+
case 59: goto tr31;
|
544
|
+
case 61: goto tr32;
|
545
|
+
case 124: goto st13;
|
546
|
+
case 126: goto st13;
|
530
547
|
}
|
531
548
|
if ( (*p) < 45 ) {
|
532
|
-
if ( (*p)
|
549
|
+
if ( (*p) < 35 ) {
|
550
|
+
if ( 9 <= (*p) && (*p) <= 12 )
|
551
|
+
goto tr18;
|
552
|
+
} else if ( (*p) > 39 ) {
|
533
553
|
if ( 42 <= (*p) && (*p) <= 43 )
|
534
|
-
goto
|
535
|
-
} else
|
536
|
-
goto
|
554
|
+
goto st13;
|
555
|
+
} else
|
556
|
+
goto st13;
|
537
557
|
} else if ( (*p) > 46 ) {
|
538
558
|
if ( (*p) < 65 ) {
|
539
559
|
if ( 48 <= (*p) && (*p) <= 57 )
|
540
|
-
goto
|
560
|
+
goto st13;
|
541
561
|
} else if ( (*p) > 90 ) {
|
542
562
|
if ( 94 <= (*p) && (*p) <= 122 )
|
543
|
-
goto
|
563
|
+
goto st13;
|
544
564
|
} else
|
545
|
-
goto
|
565
|
+
goto st13;
|
546
566
|
} else
|
547
|
-
goto
|
548
|
-
goto
|
549
|
-
|
550
|
-
#line
|
567
|
+
goto st13;
|
568
|
+
goto st0;
|
569
|
+
tr32:
|
570
|
+
#line 27 "http11_parser.rl"
|
571
|
+
{
|
572
|
+
parser->field_len = LEN(field_start, p);
|
573
|
+
}
|
574
|
+
#line 31 "http11_parser.rl"
|
551
575
|
{ MARK(mark, p); }
|
552
576
|
goto st14;
|
553
577
|
st14:
|
554
578
|
if ( ++p == pe )
|
555
579
|
goto _out14;
|
556
580
|
case 14:
|
557
|
-
#line
|
581
|
+
#line 582 "http11_parser.c"
|
558
582
|
switch( (*p) ) {
|
559
|
-
case
|
560
|
-
case
|
561
|
-
case
|
562
|
-
case 124: goto st14;
|
563
|
-
case 126: goto st14;
|
583
|
+
case 33: goto tr33;
|
584
|
+
case 124: goto tr33;
|
585
|
+
case 126: goto tr33;
|
564
586
|
}
|
565
587
|
if ( (*p) < 45 ) {
|
566
588
|
if ( (*p) > 39 ) {
|
567
589
|
if ( 42 <= (*p) && (*p) <= 43 )
|
568
|
-
goto
|
590
|
+
goto tr33;
|
569
591
|
} else if ( (*p) >= 35 )
|
570
|
-
goto
|
592
|
+
goto tr33;
|
571
593
|
} else if ( (*p) > 46 ) {
|
572
594
|
if ( (*p) < 65 ) {
|
573
595
|
if ( 48 <= (*p) && (*p) <= 57 )
|
574
|
-
goto
|
596
|
+
goto tr33;
|
575
597
|
} else if ( (*p) > 90 ) {
|
576
598
|
if ( 94 <= (*p) && (*p) <= 122 )
|
577
|
-
goto
|
599
|
+
goto tr33;
|
578
600
|
} else
|
579
|
-
goto
|
601
|
+
goto tr33;
|
580
602
|
} else
|
581
|
-
goto
|
582
|
-
goto
|
583
|
-
|
584
|
-
#line
|
585
|
-
{
|
586
|
-
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
587
|
-
}
|
588
|
-
goto st15;
|
589
|
-
tr54:
|
590
|
-
#line 27 "ext/http11_client/http11_parser.rl"
|
591
|
-
{
|
592
|
-
parser->field_len = LEN(field_start, p);
|
593
|
-
}
|
594
|
-
#line 31 "ext/http11_client/http11_parser.rl"
|
603
|
+
goto tr33;
|
604
|
+
goto st0;
|
605
|
+
tr33:
|
606
|
+
#line 31 "http11_parser.rl"
|
595
607
|
{ MARK(mark, p); }
|
596
|
-
#line 33 "ext/http11_client/http11_parser.rl"
|
597
|
-
{
|
598
|
-
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
599
|
-
}
|
600
608
|
goto st15;
|
601
609
|
st15:
|
602
610
|
if ( ++p == pe )
|
603
611
|
goto _out15;
|
604
612
|
case 15:
|
605
|
-
#line
|
613
|
+
#line 614 "http11_parser.c"
|
606
614
|
switch( (*p) ) {
|
607
|
-
case
|
608
|
-
case
|
609
|
-
case
|
615
|
+
case 13: goto tr34;
|
616
|
+
case 32: goto tr24;
|
617
|
+
case 33: goto st15;
|
618
|
+
case 59: goto tr36;
|
619
|
+
case 124: goto st15;
|
620
|
+
case 126: goto st15;
|
610
621
|
}
|
611
622
|
if ( (*p) < 45 ) {
|
612
|
-
if ( (*p)
|
623
|
+
if ( (*p) < 35 ) {
|
624
|
+
if ( 9 <= (*p) && (*p) <= 12 )
|
625
|
+
goto tr24;
|
626
|
+
} else if ( (*p) > 39 ) {
|
613
627
|
if ( 42 <= (*p) && (*p) <= 43 )
|
614
|
-
goto
|
615
|
-
} else
|
616
|
-
goto
|
628
|
+
goto st15;
|
629
|
+
} else
|
630
|
+
goto st15;
|
617
631
|
} else if ( (*p) > 46 ) {
|
618
632
|
if ( (*p) < 65 ) {
|
619
633
|
if ( 48 <= (*p) && (*p) <= 57 )
|
620
|
-
goto
|
634
|
+
goto st15;
|
621
635
|
} else if ( (*p) > 90 ) {
|
622
636
|
if ( 94 <= (*p) && (*p) <= 122 )
|
623
|
-
goto
|
637
|
+
goto st15;
|
624
638
|
} else
|
625
|
-
goto
|
639
|
+
goto st15;
|
626
640
|
} else
|
627
|
-
goto
|
628
|
-
goto
|
629
|
-
|
630
|
-
#line
|
631
|
-
{
|
641
|
+
goto st15;
|
642
|
+
goto st0;
|
643
|
+
tr40:
|
644
|
+
#line 27 "http11_parser.rl"
|
645
|
+
{
|
646
|
+
parser->field_len = LEN(field_start, p);
|
647
|
+
}
|
648
|
+
#line 31 "http11_parser.rl"
|
649
|
+
{ MARK(mark, p); }
|
650
|
+
#line 33 "http11_parser.rl"
|
651
|
+
{
|
652
|
+
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
653
|
+
}
|
654
|
+
goto st16;
|
655
|
+
tr45:
|
656
|
+
#line 33 "http11_parser.rl"
|
657
|
+
{
|
658
|
+
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
659
|
+
}
|
632
660
|
goto st16;
|
633
661
|
st16:
|
634
662
|
if ( ++p == pe )
|
635
663
|
goto _out16;
|
636
664
|
case 16:
|
637
|
-
#line
|
665
|
+
#line 666 "http11_parser.c"
|
638
666
|
switch( (*p) ) {
|
639
|
-
case
|
640
|
-
case
|
641
|
-
case
|
642
|
-
case 61: goto tr55;
|
643
|
-
case 124: goto st16;
|
644
|
-
case 126: goto st16;
|
667
|
+
case 33: goto tr37;
|
668
|
+
case 124: goto tr37;
|
669
|
+
case 126: goto tr37;
|
645
670
|
}
|
646
671
|
if ( (*p) < 45 ) {
|
647
672
|
if ( (*p) > 39 ) {
|
648
673
|
if ( 42 <= (*p) && (*p) <= 43 )
|
649
|
-
goto
|
674
|
+
goto tr37;
|
650
675
|
} else if ( (*p) >= 35 )
|
651
|
-
goto
|
676
|
+
goto tr37;
|
652
677
|
} else if ( (*p) > 46 ) {
|
653
678
|
if ( (*p) < 65 ) {
|
654
679
|
if ( 48 <= (*p) && (*p) <= 57 )
|
655
|
-
goto
|
680
|
+
goto tr37;
|
656
681
|
} else if ( (*p) > 90 ) {
|
657
682
|
if ( 94 <= (*p) && (*p) <= 122 )
|
658
|
-
goto
|
683
|
+
goto tr37;
|
659
684
|
} else
|
660
|
-
goto
|
685
|
+
goto tr37;
|
661
686
|
} else
|
662
|
-
goto
|
663
|
-
goto
|
664
|
-
|
665
|
-
#line
|
666
|
-
{
|
667
|
-
parser->field_len = LEN(field_start, p);
|
668
|
-
}
|
669
|
-
#line 31 "ext/http11_client/http11_parser.rl"
|
670
|
-
{ MARK(mark, p); }
|
687
|
+
goto tr37;
|
688
|
+
goto st0;
|
689
|
+
tr37:
|
690
|
+
#line 25 "http11_parser.rl"
|
691
|
+
{ MARK(field_start, p); }
|
671
692
|
goto st17;
|
672
693
|
st17:
|
673
694
|
if ( ++p == pe )
|
674
695
|
goto _out17;
|
675
696
|
case 17:
|
676
|
-
#line
|
697
|
+
#line 698 "http11_parser.c"
|
677
698
|
switch( (*p) ) {
|
678
|
-
case
|
679
|
-
case
|
680
|
-
case
|
699
|
+
case 13: goto tr38;
|
700
|
+
case 33: goto st17;
|
701
|
+
case 59: goto tr40;
|
702
|
+
case 61: goto tr41;
|
703
|
+
case 124: goto st17;
|
704
|
+
case 126: goto st17;
|
681
705
|
}
|
682
706
|
if ( (*p) < 45 ) {
|
683
707
|
if ( (*p) > 39 ) {
|
684
708
|
if ( 42 <= (*p) && (*p) <= 43 )
|
685
|
-
goto
|
709
|
+
goto st17;
|
686
710
|
} else if ( (*p) >= 35 )
|
687
|
-
goto
|
711
|
+
goto st17;
|
688
712
|
} else if ( (*p) > 46 ) {
|
689
713
|
if ( (*p) < 65 ) {
|
690
714
|
if ( 48 <= (*p) && (*p) <= 57 )
|
691
|
-
goto
|
715
|
+
goto st17;
|
692
716
|
} else if ( (*p) > 90 ) {
|
693
717
|
if ( 94 <= (*p) && (*p) <= 122 )
|
694
|
-
goto
|
718
|
+
goto st17;
|
695
719
|
} else
|
696
|
-
goto
|
720
|
+
goto st17;
|
697
721
|
} else
|
698
|
-
goto
|
699
|
-
goto
|
700
|
-
|
701
|
-
#line
|
722
|
+
goto st17;
|
723
|
+
goto st0;
|
724
|
+
tr41:
|
725
|
+
#line 27 "http11_parser.rl"
|
726
|
+
{
|
727
|
+
parser->field_len = LEN(field_start, p);
|
728
|
+
}
|
729
|
+
#line 31 "http11_parser.rl"
|
702
730
|
{ MARK(mark, p); }
|
703
731
|
goto st18;
|
704
732
|
st18:
|
705
733
|
if ( ++p == pe )
|
706
734
|
goto _out18;
|
707
735
|
case 18:
|
708
|
-
#line
|
736
|
+
#line 737 "http11_parser.c"
|
709
737
|
switch( (*p) ) {
|
710
|
-
case
|
711
|
-
case
|
712
|
-
case
|
713
|
-
case 124: goto st18;
|
714
|
-
case 126: goto st18;
|
738
|
+
case 33: goto tr42;
|
739
|
+
case 124: goto tr42;
|
740
|
+
case 126: goto tr42;
|
715
741
|
}
|
716
742
|
if ( (*p) < 45 ) {
|
717
743
|
if ( (*p) > 39 ) {
|
718
744
|
if ( 42 <= (*p) && (*p) <= 43 )
|
719
|
-
goto
|
745
|
+
goto tr42;
|
720
746
|
} else if ( (*p) >= 35 )
|
721
|
-
goto
|
747
|
+
goto tr42;
|
722
748
|
} else if ( (*p) > 46 ) {
|
723
749
|
if ( (*p) < 65 ) {
|
724
750
|
if ( 48 <= (*p) && (*p) <= 57 )
|
725
|
-
goto
|
751
|
+
goto tr42;
|
726
752
|
} else if ( (*p) > 90 ) {
|
727
753
|
if ( 94 <= (*p) && (*p) <= 122 )
|
728
|
-
goto
|
754
|
+
goto tr42;
|
729
755
|
} else
|
730
|
-
goto
|
756
|
+
goto tr42;
|
731
757
|
} else
|
732
|
-
goto
|
733
|
-
goto
|
734
|
-
|
735
|
-
#line
|
736
|
-
{MARK(mark, p); }
|
758
|
+
goto tr42;
|
759
|
+
goto st0;
|
760
|
+
tr42:
|
761
|
+
#line 31 "http11_parser.rl"
|
762
|
+
{ MARK(mark, p); }
|
737
763
|
goto st19;
|
738
764
|
st19:
|
739
765
|
if ( ++p == pe )
|
740
766
|
goto _out19;
|
741
767
|
case 19:
|
742
|
-
#line
|
743
|
-
|
744
|
-
goto
|
745
|
-
|
768
|
+
#line 769 "http11_parser.c"
|
769
|
+
switch( (*p) ) {
|
770
|
+
case 13: goto tr43;
|
771
|
+
case 33: goto st19;
|
772
|
+
case 59: goto tr45;
|
773
|
+
case 124: goto st19;
|
774
|
+
case 126: goto st19;
|
775
|
+
}
|
776
|
+
if ( (*p) < 45 ) {
|
777
|
+
if ( (*p) > 39 ) {
|
778
|
+
if ( 42 <= (*p) && (*p) <= 43 )
|
779
|
+
goto st19;
|
780
|
+
} else if ( (*p) >= 35 )
|
781
|
+
goto st19;
|
782
|
+
} else if ( (*p) > 46 ) {
|
783
|
+
if ( (*p) < 65 ) {
|
784
|
+
if ( 48 <= (*p) && (*p) <= 57 )
|
785
|
+
goto st19;
|
786
|
+
} else if ( (*p) > 90 ) {
|
787
|
+
if ( 94 <= (*p) && (*p) <= 122 )
|
788
|
+
goto st19;
|
789
|
+
} else
|
790
|
+
goto st19;
|
791
|
+
} else
|
792
|
+
goto st19;
|
793
|
+
goto st0;
|
794
|
+
tr5:
|
795
|
+
#line 23 "http11_parser.rl"
|
796
|
+
{MARK(mark, p); }
|
797
|
+
goto st20;
|
746
798
|
st20:
|
747
799
|
if ( ++p == pe )
|
748
800
|
goto _out20;
|
749
801
|
case 20:
|
802
|
+
#line 803 "http11_parser.c"
|
750
803
|
if ( (*p) == 84 )
|
751
804
|
goto st21;
|
752
|
-
goto
|
805
|
+
goto st0;
|
753
806
|
st21:
|
754
807
|
if ( ++p == pe )
|
755
808
|
goto _out21;
|
756
809
|
case 21:
|
757
|
-
if ( (*p) ==
|
810
|
+
if ( (*p) == 84 )
|
758
811
|
goto st22;
|
759
|
-
goto
|
812
|
+
goto st0;
|
760
813
|
st22:
|
761
814
|
if ( ++p == pe )
|
762
815
|
goto _out22;
|
763
816
|
case 22:
|
764
|
-
if ( (*p) ==
|
817
|
+
if ( (*p) == 80 )
|
765
818
|
goto st23;
|
766
|
-
goto
|
819
|
+
goto st0;
|
767
820
|
st23:
|
768
821
|
if ( ++p == pe )
|
769
822
|
goto _out23;
|
770
823
|
case 23:
|
771
|
-
if (
|
824
|
+
if ( (*p) == 47 )
|
772
825
|
goto st24;
|
773
|
-
goto
|
826
|
+
goto st0;
|
774
827
|
st24:
|
775
828
|
if ( ++p == pe )
|
776
829
|
goto _out24;
|
777
830
|
case 24:
|
778
|
-
if ( (*p) == 46 )
|
779
|
-
goto st25;
|
780
831
|
if ( 48 <= (*p) && (*p) <= 57 )
|
781
|
-
goto
|
782
|
-
goto
|
832
|
+
goto st25;
|
833
|
+
goto st0;
|
783
834
|
st25:
|
784
835
|
if ( ++p == pe )
|
785
836
|
goto _out25;
|
786
837
|
case 25:
|
787
|
-
if (
|
838
|
+
if ( (*p) == 46 )
|
788
839
|
goto st26;
|
789
|
-
|
840
|
+
if ( 48 <= (*p) && (*p) <= 57 )
|
841
|
+
goto st25;
|
842
|
+
goto st0;
|
790
843
|
st26:
|
791
844
|
if ( ++p == pe )
|
792
845
|
goto _out26;
|
793
846
|
case 26:
|
794
|
-
if ( (*p) == 32 )
|
795
|
-
goto tr13;
|
796
847
|
if ( 48 <= (*p) && (*p) <= 57 )
|
797
|
-
goto
|
798
|
-
goto
|
799
|
-
tr13:
|
800
|
-
#line 45 "ext/http11_client/http11_parser.rl"
|
801
|
-
{
|
802
|
-
parser->http_version(parser->data, PTR_TO(mark), LEN(mark, p));
|
803
|
-
}
|
804
|
-
goto st27;
|
848
|
+
goto st27;
|
849
|
+
goto st0;
|
805
850
|
st27:
|
806
851
|
if ( ++p == pe )
|
807
852
|
goto _out27;
|
808
853
|
case 27:
|
809
|
-
|
854
|
+
if ( (*p) == 32 )
|
855
|
+
goto tr53;
|
810
856
|
if ( 48 <= (*p) && (*p) <= 57 )
|
811
|
-
goto
|
812
|
-
goto
|
813
|
-
|
814
|
-
#line
|
815
|
-
{
|
857
|
+
goto st27;
|
858
|
+
goto st0;
|
859
|
+
tr53:
|
860
|
+
#line 45 "http11_parser.rl"
|
861
|
+
{
|
862
|
+
parser->http_version(parser->data, PTR_TO(mark), LEN(mark, p));
|
863
|
+
}
|
816
864
|
goto st28;
|
817
865
|
st28:
|
818
866
|
if ( ++p == pe )
|
819
867
|
goto _out28;
|
820
868
|
case 28:
|
821
|
-
#line
|
822
|
-
if ( (*p) == 32 )
|
823
|
-
goto tr11;
|
869
|
+
#line 870 "http11_parser.c"
|
824
870
|
if ( 48 <= (*p) && (*p) <= 57 )
|
825
|
-
goto
|
826
|
-
goto
|
827
|
-
|
828
|
-
#line
|
829
|
-
{
|
830
|
-
parser->status_code(parser->data, PTR_TO(mark), LEN(mark, p));
|
831
|
-
}
|
871
|
+
goto tr54;
|
872
|
+
goto st0;
|
873
|
+
tr54:
|
874
|
+
#line 23 "http11_parser.rl"
|
875
|
+
{MARK(mark, p); }
|
832
876
|
goto st29;
|
833
877
|
st29:
|
834
878
|
if ( ++p == pe )
|
835
879
|
goto _out29;
|
836
880
|
case 29:
|
837
|
-
#line
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
881
|
+
#line 882 "http11_parser.c"
|
882
|
+
if ( (*p) == 32 )
|
883
|
+
goto tr55;
|
884
|
+
if ( 48 <= (*p) && (*p) <= 57 )
|
885
|
+
goto st29;
|
886
|
+
goto st0;
|
887
|
+
tr55:
|
888
|
+
#line 41 "http11_parser.rl"
|
889
|
+
{
|
890
|
+
parser->status_code(parser->data, PTR_TO(mark), LEN(mark, p));
|
891
|
+
}
|
842
892
|
goto st30;
|
843
893
|
st30:
|
844
894
|
if ( ++p == pe )
|
845
895
|
goto _out30;
|
846
896
|
case 30:
|
847
|
-
#line
|
897
|
+
#line 898 "http11_parser.c"
|
898
|
+
goto tr57;
|
899
|
+
tr57:
|
900
|
+
#line 23 "http11_parser.rl"
|
901
|
+
{MARK(mark, p); }
|
902
|
+
goto st31;
|
903
|
+
st31:
|
904
|
+
if ( ++p == pe )
|
905
|
+
goto _out31;
|
906
|
+
case 31:
|
907
|
+
#line 908 "http11_parser.c"
|
848
908
|
if ( (*p) == 13 )
|
849
|
-
goto
|
850
|
-
goto
|
851
|
-
|
852
|
-
#line 33 "
|
909
|
+
goto tr59;
|
910
|
+
goto st31;
|
911
|
+
tr65:
|
912
|
+
#line 33 "http11_parser.rl"
|
853
913
|
{
|
854
914
|
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
855
915
|
}
|
856
|
-
goto
|
857
|
-
|
858
|
-
#line 37 "
|
916
|
+
goto st32;
|
917
|
+
tr59:
|
918
|
+
#line 37 "http11_parser.rl"
|
859
919
|
{
|
860
920
|
parser->reason_phrase(parser->data, PTR_TO(mark), LEN(mark, p));
|
861
921
|
}
|
862
|
-
goto
|
863
|
-
st31:
|
864
|
-
if ( ++p == pe )
|
865
|
-
goto _out31;
|
866
|
-
case 31:
|
867
|
-
#line 868 "ext/http11_client/http11_parser.c"
|
868
|
-
if ( (*p) == 10 )
|
869
|
-
goto st32;
|
870
|
-
goto st1;
|
922
|
+
goto st32;
|
871
923
|
st32:
|
872
924
|
if ( ++p == pe )
|
873
925
|
goto _out32;
|
874
926
|
case 32:
|
927
|
+
#line 928 "http11_parser.c"
|
928
|
+
if ( (*p) == 10 )
|
929
|
+
goto st33;
|
930
|
+
goto st0;
|
931
|
+
st33:
|
932
|
+
if ( ++p == pe )
|
933
|
+
goto _out33;
|
934
|
+
case 33:
|
875
935
|
switch( (*p) ) {
|
876
|
-
case 13: goto
|
877
|
-
case 33: goto
|
878
|
-
case 124: goto
|
879
|
-
case 126: goto
|
936
|
+
case 13: goto st5;
|
937
|
+
case 33: goto tr61;
|
938
|
+
case 124: goto tr61;
|
939
|
+
case 126: goto tr61;
|
880
940
|
}
|
881
941
|
if ( (*p) < 45 ) {
|
882
942
|
if ( (*p) > 39 ) {
|
883
943
|
if ( 42 <= (*p) && (*p) <= 43 )
|
884
|
-
goto
|
944
|
+
goto tr61;
|
885
945
|
} else if ( (*p) >= 35 )
|
886
|
-
goto
|
946
|
+
goto tr61;
|
887
947
|
} else if ( (*p) > 46 ) {
|
888
948
|
if ( (*p) < 65 ) {
|
889
949
|
if ( 48 <= (*p) && (*p) <= 57 )
|
890
|
-
goto
|
950
|
+
goto tr61;
|
891
951
|
} else if ( (*p) > 90 ) {
|
892
952
|
if ( 94 <= (*p) && (*p) <= 122 )
|
893
|
-
goto
|
953
|
+
goto tr61;
|
894
954
|
} else
|
895
|
-
goto
|
955
|
+
goto tr61;
|
896
956
|
} else
|
897
|
-
goto
|
898
|
-
goto
|
899
|
-
|
900
|
-
#line 25 "
|
957
|
+
goto tr61;
|
958
|
+
goto st0;
|
959
|
+
tr61:
|
960
|
+
#line 25 "http11_parser.rl"
|
901
961
|
{ MARK(field_start, p); }
|
902
|
-
goto
|
903
|
-
|
962
|
+
goto st34;
|
963
|
+
st34:
|
904
964
|
if ( ++p == pe )
|
905
|
-
goto
|
906
|
-
case
|
907
|
-
#line
|
965
|
+
goto _out34;
|
966
|
+
case 34:
|
967
|
+
#line 968 "http11_parser.c"
|
908
968
|
switch( (*p) ) {
|
909
|
-
case 33: goto
|
910
|
-
case 58: goto
|
911
|
-
case 124: goto
|
912
|
-
case 126: goto
|
969
|
+
case 33: goto st34;
|
970
|
+
case 58: goto tr63;
|
971
|
+
case 124: goto st34;
|
972
|
+
case 126: goto st34;
|
913
973
|
}
|
914
974
|
if ( (*p) < 45 ) {
|
915
975
|
if ( (*p) > 39 ) {
|
916
976
|
if ( 42 <= (*p) && (*p) <= 43 )
|
917
|
-
goto
|
977
|
+
goto st34;
|
918
978
|
} else if ( (*p) >= 35 )
|
919
|
-
goto
|
979
|
+
goto st34;
|
920
980
|
} else if ( (*p) > 46 ) {
|
921
981
|
if ( (*p) < 65 ) {
|
922
982
|
if ( 48 <= (*p) && (*p) <= 57 )
|
923
|
-
goto
|
983
|
+
goto st34;
|
924
984
|
} else if ( (*p) > 90 ) {
|
925
985
|
if ( 94 <= (*p) && (*p) <= 122 )
|
926
|
-
goto
|
986
|
+
goto st34;
|
927
987
|
} else
|
928
|
-
goto
|
988
|
+
goto st34;
|
929
989
|
} else
|
930
|
-
goto
|
931
|
-
goto
|
932
|
-
|
933
|
-
#line
|
990
|
+
goto st34;
|
991
|
+
goto st0;
|
992
|
+
tr66:
|
993
|
+
#line 31 "http11_parser.rl"
|
994
|
+
{ MARK(mark, p); }
|
995
|
+
goto st35;
|
996
|
+
tr63:
|
997
|
+
#line 27 "http11_parser.rl"
|
934
998
|
{
|
935
999
|
parser->field_len = LEN(field_start, p);
|
936
1000
|
}
|
937
|
-
goto st34;
|
938
|
-
tr42:
|
939
|
-
#line 31 "ext/http11_client/http11_parser.rl"
|
940
|
-
{ MARK(mark, p); }
|
941
|
-
goto st34;
|
942
|
-
st34:
|
943
|
-
if ( ++p == pe )
|
944
|
-
goto _out34;
|
945
|
-
case 34:
|
946
|
-
#line 947 "ext/http11_client/http11_parser.c"
|
947
|
-
switch( (*p) ) {
|
948
|
-
case 13: goto tr37;
|
949
|
-
case 32: goto tr42;
|
950
|
-
}
|
951
|
-
goto tr41;
|
952
|
-
tr41:
|
953
|
-
#line 31 "ext/http11_client/http11_parser.rl"
|
954
|
-
{ MARK(mark, p); }
|
955
1001
|
goto st35;
|
956
1002
|
st35:
|
957
1003
|
if ( ++p == pe )
|
958
1004
|
goto _out35;
|
959
1005
|
case 35:
|
960
|
-
#line
|
1006
|
+
#line 1007 "http11_parser.c"
|
1007
|
+
switch( (*p) ) {
|
1008
|
+
case 13: goto tr65;
|
1009
|
+
case 32: goto tr66;
|
1010
|
+
}
|
1011
|
+
goto tr64;
|
1012
|
+
tr64:
|
1013
|
+
#line 31 "http11_parser.rl"
|
1014
|
+
{ MARK(mark, p); }
|
1015
|
+
goto st36;
|
1016
|
+
st36:
|
1017
|
+
if ( ++p == pe )
|
1018
|
+
goto _out36;
|
1019
|
+
case 36:
|
1020
|
+
#line 1021 "http11_parser.c"
|
961
1021
|
if ( (*p) == 13 )
|
962
|
-
goto
|
963
|
-
goto
|
1022
|
+
goto tr65;
|
1023
|
+
goto st36;
|
964
1024
|
}
|
965
|
-
|
1025
|
+
_out0: cs = 0; goto _out;
|
966
1026
|
_out2: cs = 2; goto _out;
|
967
|
-
|
1027
|
+
_out37: cs = 37; goto _out;
|
968
1028
|
_out3: cs = 3; goto _out;
|
969
1029
|
_out4: cs = 4; goto _out;
|
970
1030
|
_out5: cs = 5; goto _out;
|
@@ -998,10 +1058,11 @@ case 35:
|
|
998
1058
|
_out33: cs = 33; goto _out;
|
999
1059
|
_out34: cs = 34; goto _out;
|
1000
1060
|
_out35: cs = 35; goto _out;
|
1061
|
+
_out36: cs = 36; goto _out;
|
1001
1062
|
|
1002
1063
|
_out: {}
|
1003
1064
|
}
|
1004
|
-
#line 130 "
|
1065
|
+
#line 130 "http11_parser.rl"
|
1005
1066
|
|
1006
1067
|
parser->cs = cs;
|
1007
1068
|
parser->nread += p - (buffer + off);
|
@@ -1016,8 +1077,8 @@ case 35:
|
|
1016
1077
|
if(parser->body_start) {
|
1017
1078
|
/* final \r\n combo encountered so stop right here */
|
1018
1079
|
|
1019
|
-
#line
|
1020
|
-
#line 144 "
|
1080
|
+
#line 1081 "http11_parser.c"
|
1081
|
+
#line 144 "http11_parser.rl"
|
1021
1082
|
parser->nread++;
|
1022
1083
|
}
|
1023
1084
|
|
@@ -1029,8 +1090,8 @@ int httpclient_parser_finish(httpclient_parser *parser)
|
|
1029
1090
|
int cs = parser->cs;
|
1030
1091
|
|
1031
1092
|
|
1032
|
-
#line
|
1033
|
-
#line 155 "
|
1093
|
+
#line 1094 "http11_parser.c"
|
1094
|
+
#line 155 "http11_parser.rl"
|
1034
1095
|
|
1035
1096
|
parser->cs = cs;
|
1036
1097
|
|