puma 3.9.1 → 4.3.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puma might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/History.md +232 -0
- data/README.md +162 -224
- data/docs/architecture.md +37 -0
- data/{DEPLOYMENT.md → docs/deployment.md} +24 -4
- data/docs/images/puma-connection-flow-no-reactor.png +0 -0
- data/docs/images/puma-connection-flow.png +0 -0
- data/docs/images/puma-general-arch.png +0 -0
- data/docs/plugins.md +38 -0
- data/docs/restart.md +41 -0
- data/docs/signals.md +56 -3
- data/docs/systemd.md +130 -37
- data/docs/tcp_mode.md +96 -0
- data/ext/puma_http11/PumaHttp11Service.java +2 -0
- data/ext/puma_http11/extconf.rb +13 -0
- data/ext/puma_http11/http11_parser.c +115 -140
- data/ext/puma_http11/http11_parser.java.rl +21 -37
- data/ext/puma_http11/http11_parser.rl +9 -9
- data/ext/puma_http11/http11_parser_common.rl +3 -3
- data/ext/puma_http11/mini_ssl.c +104 -8
- data/ext/puma_http11/org/jruby/puma/Http11.java +106 -114
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +90 -108
- data/ext/puma_http11/org/jruby/puma/IOBuffer.java +72 -0
- data/ext/puma_http11/org/jruby/puma/MiniSSL.java +21 -4
- data/ext/puma_http11/puma_http11.c +2 -0
- data/lib/puma.rb +16 -0
- data/lib/puma/accept_nonblock.rb +7 -1
- data/lib/puma/app/status.rb +40 -26
- data/lib/puma/binder.rb +57 -74
- data/lib/puma/cli.rb +26 -7
- data/lib/puma/client.rb +243 -190
- data/lib/puma/cluster.rb +78 -34
- data/lib/puma/commonlogger.rb +2 -0
- data/lib/puma/configuration.rb +24 -16
- data/lib/puma/const.rb +36 -18
- data/lib/puma/control_cli.rb +46 -19
- data/lib/puma/detect.rb +2 -0
- data/lib/puma/dsl.rb +329 -68
- data/lib/puma/events.rb +6 -1
- data/lib/puma/io_buffer.rb +3 -6
- data/lib/puma/jruby_restart.rb +2 -1
- data/lib/puma/launcher.rb +120 -58
- data/lib/puma/minissl.rb +69 -27
- data/lib/puma/minissl/context_builder.rb +76 -0
- data/lib/puma/null_io.rb +2 -0
- data/lib/puma/plugin.rb +7 -2
- data/lib/puma/plugin/tmp_restart.rb +2 -1
- data/lib/puma/rack/builder.rb +4 -1
- data/lib/puma/rack/urlmap.rb +2 -0
- data/lib/puma/rack_default.rb +2 -0
- data/lib/puma/reactor.rb +224 -34
- data/lib/puma/runner.rb +25 -4
- data/lib/puma/server.rb +148 -62
- data/lib/puma/single.rb +16 -5
- data/lib/puma/state_file.rb +2 -0
- data/lib/puma/tcp_logger.rb +2 -0
- data/lib/puma/thread_pool.rb +61 -38
- data/lib/puma/util.rb +2 -6
- data/lib/rack/handler/puma.rb +10 -4
- data/tools/docker/Dockerfile +16 -0
- data/tools/jungle/README.md +12 -2
- data/tools/jungle/init.d/README.md +2 -0
- data/tools/jungle/init.d/puma +8 -8
- data/tools/jungle/init.d/run-puma +1 -1
- data/tools/jungle/rc.d/README.md +74 -0
- data/tools/jungle/rc.d/puma +61 -0
- data/tools/jungle/rc.d/puma.conf +10 -0
- data/tools/trickletest.rb +1 -2
- metadata +29 -56
- data/.github/issue_template.md +0 -20
- data/Gemfile +0 -14
- data/Manifest.txt +0 -78
- data/Rakefile +0 -165
- data/Release.md +0 -9
- data/gemfiles/2.1-Gemfile +0 -12
- data/lib/puma/compat.rb +0 -14
- data/lib/puma/convenient.rb +0 -23
- data/lib/puma/daemon_ext.rb +0 -31
- data/lib/puma/delegation.rb +0 -11
- data/lib/puma/java_io_buffer.rb +0 -45
- data/lib/puma/rack/backports/uri/common_193.rb +0 -33
- data/puma.gemspec +0 -20
data/docs/tcp_mode.md
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
# TCP mode
|
2
|
+
|
3
|
+
Puma also could be used as a TCP server to process incoming TCP
|
4
|
+
connections.
|
5
|
+
|
6
|
+
|
7
|
+
## Configuration
|
8
|
+
|
9
|
+
TCP mode can be enabled with CLI option `--tcp-mode`:
|
10
|
+
|
11
|
+
```
|
12
|
+
$ puma --tcp-mode
|
13
|
+
```
|
14
|
+
|
15
|
+
Default ip and port to listen to are `0.0.0.0` and `9292`. You can configure
|
16
|
+
them with `--port` and `--bind` options:
|
17
|
+
|
18
|
+
```
|
19
|
+
$ puma --tcp-mode --bind tcp://127.0.0.1:9293
|
20
|
+
$ puma --tcp-mode --port 9293
|
21
|
+
```
|
22
|
+
|
23
|
+
TCP mode could be set with a configuration file as well with `tcp_mode`
|
24
|
+
and `tcp_mode!` methods:
|
25
|
+
|
26
|
+
```
|
27
|
+
# config/puma.rb
|
28
|
+
tcp_mode
|
29
|
+
```
|
30
|
+
|
31
|
+
When Puma starts in the TCP mode it prints the corresponding message:
|
32
|
+
|
33
|
+
```
|
34
|
+
puma --tcp-mode
|
35
|
+
Puma starting in single mode...
|
36
|
+
...
|
37
|
+
* Mode: Lopez Express (tcp)
|
38
|
+
```
|
39
|
+
|
40
|
+
|
41
|
+
## How to declare an application
|
42
|
+
|
43
|
+
An application to process TCP connections should be declared as a
|
44
|
+
callable object which accepts `env` and `socket` arguments.
|
45
|
+
|
46
|
+
`env` argument is a Hash with following structure:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
{ "thread" => {}, "REMOTE_ADDR" => "127.0.0.1:51133", "log" => "#<Proc:0x000..." }
|
50
|
+
```
|
51
|
+
|
52
|
+
It consists of:
|
53
|
+
* `thread` - a Hash for each thread in the thread pool that could be
|
54
|
+
used to store information between requests
|
55
|
+
* `REMOTE_ADDR` - a client ip address
|
56
|
+
* `log` - a proc object to write something down
|
57
|
+
|
58
|
+
`log` object could be used this way:
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
env['log'].call('message to log')
|
62
|
+
#> 19/Oct/2019 20:28:53 - 127.0.0.1:51266 - message to log
|
63
|
+
```
|
64
|
+
|
65
|
+
|
66
|
+
## Example of an application
|
67
|
+
|
68
|
+
Let's look at an example of a simple application which just echoes
|
69
|
+
incoming string:
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
# config/puma.rb
|
73
|
+
app do |env, socket|
|
74
|
+
s = socket.gets
|
75
|
+
socket.puts "Echo #{s}"
|
76
|
+
end
|
77
|
+
```
|
78
|
+
|
79
|
+
We can easily access the TCP server with `telnet` command and receive an
|
80
|
+
echo:
|
81
|
+
|
82
|
+
```shell
|
83
|
+
telnet 0.0.0.0 9293
|
84
|
+
Trying 0.0.0.0...
|
85
|
+
Connected to 0.0.0.0.
|
86
|
+
Escape character is '^]'.
|
87
|
+
sssss
|
88
|
+
Echo sssss
|
89
|
+
^CConnection closed by foreign host.
|
90
|
+
```
|
91
|
+
|
92
|
+
|
93
|
+
## Socket management
|
94
|
+
|
95
|
+
After the application finishes, Puma closes the socket. In order to
|
96
|
+
prevent this, the application should set `env['detach'] = true`.
|
@@ -6,11 +6,13 @@ import org.jruby.Ruby;
|
|
6
6
|
import org.jruby.runtime.load.BasicLibraryService;
|
7
7
|
|
8
8
|
import org.jruby.puma.Http11;
|
9
|
+
import org.jruby.puma.IOBuffer;
|
9
10
|
import org.jruby.puma.MiniSSL;
|
10
11
|
|
11
12
|
public class PumaHttp11Service implements BasicLibraryService {
|
12
13
|
public boolean basicLoad(final Ruby runtime) throws IOException {
|
13
14
|
Http11.createHttp11(runtime);
|
15
|
+
IOBuffer.createIOBuffer(runtime);
|
14
16
|
MiniSSL.createMiniSSL(runtime);
|
15
17
|
return true;
|
16
18
|
}
|
data/ext/puma_http11/extconf.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
require 'mkmf'
|
2
2
|
|
3
3
|
dir_config("puma_http11")
|
4
|
+
if RUBY_PLATFORM[/mingw32/]
|
5
|
+
append_cflags '-D_FORTIFY_SOURCE=2'
|
6
|
+
append_ldflags '-fstack-protector'
|
7
|
+
have_library 'ssp'
|
8
|
+
end
|
4
9
|
|
5
10
|
unless ENV["DISABLE_SSL"]
|
6
11
|
dir_config("openssl")
|
@@ -9,6 +14,14 @@ unless ENV["DISABLE_SSL"]
|
|
9
14
|
%w'ssl ssleay32'.find {|ssl| have_library(ssl, 'SSL_CTX_new')}
|
10
15
|
|
11
16
|
have_header "openssl/bio.h"
|
17
|
+
|
18
|
+
# below is yes for 1.0.2 & later
|
19
|
+
have_func "DTLS_method" , "openssl/ssl.h"
|
20
|
+
|
21
|
+
# below are yes for 1.1.0 & later, may need to check func rather than macro
|
22
|
+
# with versions after 1.1.1
|
23
|
+
have_func "TLS_server_method" , "openssl/ssl.h"
|
24
|
+
have_macro "SSL_CTX_set_min_proto_version", "openssl/ssl.h"
|
12
25
|
end
|
13
26
|
end
|
14
27
|
|
@@ -31,30 +31,30 @@ static void snake_upcase_char(char *c)
|
|
31
31
|
/** Machine **/
|
32
32
|
|
33
33
|
|
34
|
-
#line
|
34
|
+
#line 79 "ext/puma_http11/http11_parser.rl"
|
35
35
|
|
36
36
|
|
37
37
|
/** Data **/
|
38
38
|
|
39
|
-
#line
|
39
|
+
#line 40 "ext/puma_http11/http11_parser.c"
|
40
40
|
static const int puma_parser_start = 1;
|
41
|
-
static const int puma_parser_first_final =
|
41
|
+
static const int puma_parser_first_final = 46;
|
42
42
|
static const int puma_parser_error = 0;
|
43
43
|
|
44
44
|
static const int puma_parser_en_main = 1;
|
45
45
|
|
46
46
|
|
47
|
-
#line
|
47
|
+
#line 83 "ext/puma_http11/http11_parser.rl"
|
48
48
|
|
49
49
|
int puma_parser_init(puma_parser *parser) {
|
50
50
|
int cs = 0;
|
51
51
|
|
52
|
-
#line
|
52
|
+
#line 53 "ext/puma_http11/http11_parser.c"
|
53
53
|
{
|
54
54
|
cs = puma_parser_start;
|
55
55
|
}
|
56
56
|
|
57
|
-
#line
|
57
|
+
#line 87 "ext/puma_http11/http11_parser.rl"
|
58
58
|
parser->cs = cs;
|
59
59
|
parser->body_start = 0;
|
60
60
|
parser->content_len = 0;
|
@@ -80,10 +80,10 @@ size_t puma_parser_execute(puma_parser *parser, const char *buffer, size_t len,
|
|
80
80
|
pe = buffer+len;
|
81
81
|
|
82
82
|
/* assert(*pe == '\0' && "pointer does not end on NUL"); */
|
83
|
-
assert(pe - p == len - off && "pointers aren't same distance");
|
83
|
+
assert((size_t) (pe - p) == len - off && "pointers aren't same distance");
|
84
84
|
|
85
85
|
|
86
|
-
#line
|
86
|
+
#line 87 "ext/puma_http11/http11_parser.c"
|
87
87
|
{
|
88
88
|
if ( p == pe )
|
89
89
|
goto _test_eof;
|
@@ -107,31 +107,31 @@ st0:
|
|
107
107
|
cs = 0;
|
108
108
|
goto _out;
|
109
109
|
tr0:
|
110
|
-
#line
|
110
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
111
111
|
{ MARK(mark, p); }
|
112
112
|
goto st2;
|
113
113
|
st2:
|
114
114
|
if ( ++p == pe )
|
115
115
|
goto _test_eof2;
|
116
116
|
case 2:
|
117
|
-
#line
|
117
|
+
#line 118 "ext/puma_http11/http11_parser.c"
|
118
118
|
switch( (*p) ) {
|
119
119
|
case 32: goto tr2;
|
120
|
-
case 36: goto
|
121
|
-
case 95: goto
|
120
|
+
case 36: goto st27;
|
121
|
+
case 95: goto st27;
|
122
122
|
}
|
123
123
|
if ( (*p) < 48 ) {
|
124
124
|
if ( 45 <= (*p) && (*p) <= 46 )
|
125
|
-
goto
|
125
|
+
goto st27;
|
126
126
|
} else if ( (*p) > 57 ) {
|
127
127
|
if ( 65 <= (*p) && (*p) <= 90 )
|
128
|
-
goto
|
128
|
+
goto st27;
|
129
129
|
} else
|
130
|
-
goto
|
130
|
+
goto st27;
|
131
131
|
goto st0;
|
132
132
|
tr2:
|
133
|
-
#line
|
134
|
-
{
|
133
|
+
#line 48 "ext/puma_http11/http11_parser.rl"
|
134
|
+
{
|
135
135
|
parser->request_method(parser, PTR_TO(mark), LEN(mark, p));
|
136
136
|
}
|
137
137
|
goto st3;
|
@@ -139,7 +139,7 @@ st3:
|
|
139
139
|
if ( ++p == pe )
|
140
140
|
goto _test_eof3;
|
141
141
|
case 3:
|
142
|
-
#line
|
142
|
+
#line 143 "ext/puma_http11/http11_parser.c"
|
143
143
|
switch( (*p) ) {
|
144
144
|
case 42: goto tr4;
|
145
145
|
case 43: goto tr5;
|
@@ -156,68 +156,68 @@ case 3:
|
|
156
156
|
goto tr5;
|
157
157
|
goto st0;
|
158
158
|
tr4:
|
159
|
-
#line
|
159
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
160
160
|
{ MARK(mark, p); }
|
161
161
|
goto st4;
|
162
162
|
st4:
|
163
163
|
if ( ++p == pe )
|
164
164
|
goto _test_eof4;
|
165
165
|
case 4:
|
166
|
-
#line
|
166
|
+
#line 167 "ext/puma_http11/http11_parser.c"
|
167
167
|
switch( (*p) ) {
|
168
168
|
case 32: goto tr8;
|
169
169
|
case 35: goto tr9;
|
170
170
|
}
|
171
171
|
goto st0;
|
172
172
|
tr8:
|
173
|
-
#line
|
174
|
-
{
|
173
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
174
|
+
{
|
175
175
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
176
176
|
}
|
177
177
|
goto st5;
|
178
178
|
tr31:
|
179
|
-
#line
|
179
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
180
180
|
{ MARK(mark, p); }
|
181
|
-
#line
|
181
|
+
#line 54 "ext/puma_http11/http11_parser.rl"
|
182
182
|
{
|
183
183
|
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
|
184
184
|
}
|
185
185
|
goto st5;
|
186
186
|
tr33:
|
187
|
-
#line
|
187
|
+
#line 54 "ext/puma_http11/http11_parser.rl"
|
188
188
|
{
|
189
189
|
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
|
190
190
|
}
|
191
191
|
goto st5;
|
192
192
|
tr37:
|
193
|
-
#line
|
193
|
+
#line 67 "ext/puma_http11/http11_parser.rl"
|
194
194
|
{
|
195
195
|
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
196
196
|
}
|
197
|
-
#line
|
198
|
-
{
|
197
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
198
|
+
{
|
199
199
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
200
200
|
}
|
201
201
|
goto st5;
|
202
|
-
|
203
|
-
#line 57 "ext/puma_http11/http11_parser.rl"
|
204
|
-
{ MARK(query_start, p); }
|
202
|
+
tr41:
|
205
203
|
#line 58 "ext/puma_http11/http11_parser.rl"
|
206
|
-
{
|
204
|
+
{ MARK(query_start, p); }
|
205
|
+
#line 59 "ext/puma_http11/http11_parser.rl"
|
206
|
+
{
|
207
207
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
208
208
|
}
|
209
|
-
#line
|
210
|
-
{
|
209
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
210
|
+
{
|
211
211
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
212
212
|
}
|
213
213
|
goto st5;
|
214
|
-
|
215
|
-
#line
|
216
|
-
{
|
214
|
+
tr44:
|
215
|
+
#line 59 "ext/puma_http11/http11_parser.rl"
|
216
|
+
{
|
217
217
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
218
218
|
}
|
219
|
-
#line
|
220
|
-
{
|
219
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
220
|
+
{
|
221
221
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
222
222
|
}
|
223
223
|
goto st5;
|
@@ -225,19 +225,19 @@ st5:
|
|
225
225
|
if ( ++p == pe )
|
226
226
|
goto _test_eof5;
|
227
227
|
case 5:
|
228
|
-
#line
|
228
|
+
#line 229 "ext/puma_http11/http11_parser.c"
|
229
229
|
if ( (*p) == 72 )
|
230
230
|
goto tr10;
|
231
231
|
goto st0;
|
232
232
|
tr10:
|
233
|
-
#line
|
233
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
234
234
|
{ MARK(mark, p); }
|
235
235
|
goto st6;
|
236
236
|
st6:
|
237
237
|
if ( ++p == pe )
|
238
238
|
goto _test_eof6;
|
239
239
|
case 6:
|
240
|
-
#line
|
240
|
+
#line 241 "ext/puma_http11/http11_parser.c"
|
241
241
|
if ( (*p) == 84 )
|
242
242
|
goto st7;
|
243
243
|
goto st0;
|
@@ -295,21 +295,21 @@ case 13:
|
|
295
295
|
goto st13;
|
296
296
|
goto st0;
|
297
297
|
tr18:
|
298
|
-
#line
|
299
|
-
{
|
298
|
+
#line 63 "ext/puma_http11/http11_parser.rl"
|
299
|
+
{
|
300
300
|
parser->http_version(parser, PTR_TO(mark), LEN(mark, p));
|
301
301
|
}
|
302
302
|
goto st14;
|
303
303
|
tr26:
|
304
|
-
#line 43 "ext/puma_http11/http11_parser.rl"
|
305
|
-
{ MARK(mark, p); }
|
306
304
|
#line 44 "ext/puma_http11/http11_parser.rl"
|
305
|
+
{ MARK(mark, p); }
|
306
|
+
#line 45 "ext/puma_http11/http11_parser.rl"
|
307
307
|
{
|
308
308
|
parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
309
309
|
}
|
310
310
|
goto st14;
|
311
311
|
tr29:
|
312
|
-
#line
|
312
|
+
#line 45 "ext/puma_http11/http11_parser.rl"
|
313
313
|
{
|
314
314
|
parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
315
315
|
}
|
@@ -318,7 +318,7 @@ st14:
|
|
318
318
|
if ( ++p == pe )
|
319
319
|
goto _test_eof14;
|
320
320
|
case 14:
|
321
|
-
#line
|
321
|
+
#line 322 "ext/puma_http11/http11_parser.c"
|
322
322
|
if ( (*p) == 10 )
|
323
323
|
goto st15;
|
324
324
|
goto st0;
|
@@ -358,34 +358,34 @@ case 16:
|
|
358
358
|
goto tr22;
|
359
359
|
goto st0;
|
360
360
|
tr22:
|
361
|
-
#line
|
362
|
-
{
|
363
|
-
parser->body_start = p - buffer + 1;
|
361
|
+
#line 71 "ext/puma_http11/http11_parser.rl"
|
362
|
+
{
|
363
|
+
parser->body_start = p - buffer + 1;
|
364
364
|
parser->header_done(parser, p + 1, pe - p - 1);
|
365
|
-
{p++; cs =
|
365
|
+
{p++; cs = 46; goto _out;}
|
366
366
|
}
|
367
|
-
goto
|
368
|
-
|
367
|
+
goto st46;
|
368
|
+
st46:
|
369
369
|
if ( ++p == pe )
|
370
|
-
goto
|
371
|
-
case
|
372
|
-
#line
|
370
|
+
goto _test_eof46;
|
371
|
+
case 46:
|
372
|
+
#line 373 "ext/puma_http11/http11_parser.c"
|
373
373
|
goto st0;
|
374
374
|
tr21:
|
375
|
-
#line 37 "ext/puma_http11/http11_parser.rl"
|
376
|
-
{ MARK(field_start, p); }
|
377
375
|
#line 38 "ext/puma_http11/http11_parser.rl"
|
376
|
+
{ MARK(field_start, p); }
|
377
|
+
#line 39 "ext/puma_http11/http11_parser.rl"
|
378
378
|
{ snake_upcase_char((char *)p); }
|
379
379
|
goto st17;
|
380
380
|
tr23:
|
381
|
-
#line
|
381
|
+
#line 39 "ext/puma_http11/http11_parser.rl"
|
382
382
|
{ snake_upcase_char((char *)p); }
|
383
383
|
goto st17;
|
384
384
|
st17:
|
385
385
|
if ( ++p == pe )
|
386
386
|
goto _test_eof17;
|
387
387
|
case 17:
|
388
|
-
#line
|
388
|
+
#line 389 "ext/puma_http11/http11_parser.c"
|
389
389
|
switch( (*p) ) {
|
390
390
|
case 33: goto tr23;
|
391
391
|
case 58: goto tr24;
|
@@ -411,72 +411,72 @@ case 17:
|
|
411
411
|
goto tr23;
|
412
412
|
goto st0;
|
413
413
|
tr24:
|
414
|
-
#line
|
415
|
-
{
|
414
|
+
#line 40 "ext/puma_http11/http11_parser.rl"
|
415
|
+
{
|
416
416
|
parser->field_len = LEN(field_start, p);
|
417
417
|
}
|
418
418
|
goto st18;
|
419
419
|
tr27:
|
420
|
-
#line
|
420
|
+
#line 44 "ext/puma_http11/http11_parser.rl"
|
421
421
|
{ MARK(mark, p); }
|
422
422
|
goto st18;
|
423
423
|
st18:
|
424
424
|
if ( ++p == pe )
|
425
425
|
goto _test_eof18;
|
426
426
|
case 18:
|
427
|
-
#line
|
427
|
+
#line 428 "ext/puma_http11/http11_parser.c"
|
428
428
|
switch( (*p) ) {
|
429
429
|
case 13: goto tr26;
|
430
430
|
case 32: goto tr27;
|
431
431
|
}
|
432
432
|
goto tr25;
|
433
433
|
tr25:
|
434
|
-
#line
|
434
|
+
#line 44 "ext/puma_http11/http11_parser.rl"
|
435
435
|
{ MARK(mark, p); }
|
436
436
|
goto st19;
|
437
437
|
st19:
|
438
438
|
if ( ++p == pe )
|
439
439
|
goto _test_eof19;
|
440
440
|
case 19:
|
441
|
-
#line
|
441
|
+
#line 442 "ext/puma_http11/http11_parser.c"
|
442
442
|
if ( (*p) == 13 )
|
443
443
|
goto tr29;
|
444
444
|
goto st19;
|
445
445
|
tr9:
|
446
|
-
#line
|
447
|
-
{
|
446
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
447
|
+
{
|
448
448
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
449
449
|
}
|
450
450
|
goto st20;
|
451
451
|
tr38:
|
452
|
-
#line
|
452
|
+
#line 67 "ext/puma_http11/http11_parser.rl"
|
453
453
|
{
|
454
454
|
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
455
455
|
}
|
456
|
-
#line
|
457
|
-
{
|
456
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
457
|
+
{
|
458
458
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
459
459
|
}
|
460
460
|
goto st20;
|
461
|
-
|
462
|
-
#line 57 "ext/puma_http11/http11_parser.rl"
|
463
|
-
{ MARK(query_start, p); }
|
461
|
+
tr42:
|
464
462
|
#line 58 "ext/puma_http11/http11_parser.rl"
|
465
|
-
{
|
463
|
+
{ MARK(query_start, p); }
|
464
|
+
#line 59 "ext/puma_http11/http11_parser.rl"
|
465
|
+
{
|
466
466
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
467
467
|
}
|
468
|
-
#line
|
469
|
-
{
|
468
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
469
|
+
{
|
470
470
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
471
471
|
}
|
472
472
|
goto st20;
|
473
|
-
|
474
|
-
#line
|
475
|
-
{
|
473
|
+
tr45:
|
474
|
+
#line 59 "ext/puma_http11/http11_parser.rl"
|
475
|
+
{
|
476
476
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
477
477
|
}
|
478
|
-
#line
|
479
|
-
{
|
478
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
479
|
+
{
|
480
480
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
481
481
|
}
|
482
482
|
goto st20;
|
@@ -484,7 +484,7 @@ st20:
|
|
484
484
|
if ( ++p == pe )
|
485
485
|
goto _test_eof20;
|
486
486
|
case 20:
|
487
|
-
#line
|
487
|
+
#line 488 "ext/puma_http11/http11_parser.c"
|
488
488
|
switch( (*p) ) {
|
489
489
|
case 32: goto tr31;
|
490
490
|
case 60: goto st0;
|
@@ -498,14 +498,14 @@ case 20:
|
|
498
498
|
goto st0;
|
499
499
|
goto tr30;
|
500
500
|
tr30:
|
501
|
-
#line
|
501
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
502
502
|
{ MARK(mark, p); }
|
503
503
|
goto st21;
|
504
504
|
st21:
|
505
505
|
if ( ++p == pe )
|
506
506
|
goto _test_eof21;
|
507
507
|
case 21:
|
508
|
-
#line
|
508
|
+
#line 509 "ext/puma_http11/http11_parser.c"
|
509
509
|
switch( (*p) ) {
|
510
510
|
case 32: goto tr33;
|
511
511
|
case 60: goto st0;
|
@@ -519,14 +519,14 @@ case 21:
|
|
519
519
|
goto st0;
|
520
520
|
goto st21;
|
521
521
|
tr5:
|
522
|
-
#line
|
522
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
523
523
|
{ MARK(mark, p); }
|
524
524
|
goto st22;
|
525
525
|
st22:
|
526
526
|
if ( ++p == pe )
|
527
527
|
goto _test_eof22;
|
528
528
|
case 22:
|
529
|
-
#line
|
529
|
+
#line 530 "ext/puma_http11/http11_parser.c"
|
530
530
|
switch( (*p) ) {
|
531
531
|
case 43: goto st22;
|
532
532
|
case 58: goto st23;
|
@@ -544,14 +544,14 @@ case 22:
|
|
544
544
|
goto st22;
|
545
545
|
goto st0;
|
546
546
|
tr7:
|
547
|
-
#line
|
547
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
548
548
|
{ MARK(mark, p); }
|
549
549
|
goto st23;
|
550
550
|
st23:
|
551
551
|
if ( ++p == pe )
|
552
552
|
goto _test_eof23;
|
553
553
|
case 23:
|
554
|
-
#line
|
554
|
+
#line 555 "ext/puma_http11/http11_parser.c"
|
555
555
|
switch( (*p) ) {
|
556
556
|
case 32: goto tr8;
|
557
557
|
case 34: goto st0;
|
@@ -564,29 +564,28 @@ case 23:
|
|
564
564
|
goto st0;
|
565
565
|
goto st23;
|
566
566
|
tr6:
|
567
|
-
#line
|
567
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
568
568
|
{ MARK(mark, p); }
|
569
569
|
goto st24;
|
570
570
|
st24:
|
571
571
|
if ( ++p == pe )
|
572
572
|
goto _test_eof24;
|
573
573
|
case 24:
|
574
|
-
#line
|
574
|
+
#line 575 "ext/puma_http11/http11_parser.c"
|
575
575
|
switch( (*p) ) {
|
576
576
|
case 32: goto tr37;
|
577
577
|
case 34: goto st0;
|
578
578
|
case 35: goto tr38;
|
579
|
-
case 59: goto tr39;
|
580
579
|
case 60: goto st0;
|
581
580
|
case 62: goto st0;
|
582
|
-
case 63: goto
|
581
|
+
case 63: goto tr39;
|
583
582
|
case 127: goto st0;
|
584
583
|
}
|
585
584
|
if ( 0 <= (*p) && (*p) <= 31 )
|
586
585
|
goto st0;
|
587
586
|
goto st24;
|
588
587
|
tr39:
|
589
|
-
#line
|
588
|
+
#line 67 "ext/puma_http11/http11_parser.rl"
|
590
589
|
{
|
591
590
|
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
592
591
|
}
|
@@ -597,28 +596,25 @@ st25:
|
|
597
596
|
case 25:
|
598
597
|
#line 598 "ext/puma_http11/http11_parser.c"
|
599
598
|
switch( (*p) ) {
|
600
|
-
case 32: goto
|
599
|
+
case 32: goto tr41;
|
601
600
|
case 34: goto st0;
|
602
|
-
case 35: goto
|
601
|
+
case 35: goto tr42;
|
603
602
|
case 60: goto st0;
|
604
603
|
case 62: goto st0;
|
605
|
-
case 63: goto st26;
|
606
604
|
case 127: goto st0;
|
607
605
|
}
|
608
606
|
if ( 0 <= (*p) && (*p) <= 31 )
|
609
607
|
goto st0;
|
610
|
-
goto
|
608
|
+
goto tr40;
|
611
609
|
tr40:
|
612
|
-
#line
|
613
|
-
{
|
614
|
-
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
615
|
-
}
|
610
|
+
#line 58 "ext/puma_http11/http11_parser.rl"
|
611
|
+
{ MARK(query_start, p); }
|
616
612
|
goto st26;
|
617
613
|
st26:
|
618
614
|
if ( ++p == pe )
|
619
615
|
goto _test_eof26;
|
620
616
|
case 26:
|
621
|
-
#line
|
617
|
+
#line 618 "ext/puma_http11/http11_parser.c"
|
622
618
|
switch( (*p) ) {
|
623
619
|
case 32: goto tr44;
|
624
620
|
case 34: goto st0;
|
@@ -629,27 +625,25 @@ case 26:
|
|
629
625
|
}
|
630
626
|
if ( 0 <= (*p) && (*p) <= 31 )
|
631
627
|
goto st0;
|
632
|
-
goto
|
633
|
-
tr43:
|
634
|
-
#line 57 "ext/puma_http11/http11_parser.rl"
|
635
|
-
{ MARK(query_start, p); }
|
636
|
-
goto st27;
|
628
|
+
goto st26;
|
637
629
|
st27:
|
638
630
|
if ( ++p == pe )
|
639
631
|
goto _test_eof27;
|
640
632
|
case 27:
|
641
|
-
#line 641 "ext/puma_http11/http11_parser.c"
|
642
633
|
switch( (*p) ) {
|
643
|
-
case 32: goto
|
644
|
-
case
|
645
|
-
case
|
646
|
-
case 60: goto st0;
|
647
|
-
case 62: goto st0;
|
648
|
-
case 127: goto st0;
|
634
|
+
case 32: goto tr2;
|
635
|
+
case 36: goto st28;
|
636
|
+
case 95: goto st28;
|
649
637
|
}
|
650
|
-
if (
|
651
|
-
|
652
|
-
|
638
|
+
if ( (*p) < 48 ) {
|
639
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
640
|
+
goto st28;
|
641
|
+
} else if ( (*p) > 57 ) {
|
642
|
+
if ( 65 <= (*p) && (*p) <= 90 )
|
643
|
+
goto st28;
|
644
|
+
} else
|
645
|
+
goto st28;
|
646
|
+
goto st0;
|
653
647
|
st28:
|
654
648
|
if ( ++p == pe )
|
655
649
|
goto _test_eof28;
|
@@ -960,24 +954,6 @@ st45:
|
|
960
954
|
if ( ++p == pe )
|
961
955
|
goto _test_eof45;
|
962
956
|
case 45:
|
963
|
-
switch( (*p) ) {
|
964
|
-
case 32: goto tr2;
|
965
|
-
case 36: goto st46;
|
966
|
-
case 95: goto st46;
|
967
|
-
}
|
968
|
-
if ( (*p) < 48 ) {
|
969
|
-
if ( 45 <= (*p) && (*p) <= 46 )
|
970
|
-
goto st46;
|
971
|
-
} else if ( (*p) > 57 ) {
|
972
|
-
if ( 65 <= (*p) && (*p) <= 90 )
|
973
|
-
goto st46;
|
974
|
-
} else
|
975
|
-
goto st46;
|
976
|
-
goto st0;
|
977
|
-
st46:
|
978
|
-
if ( ++p == pe )
|
979
|
-
goto _test_eof46;
|
980
|
-
case 46:
|
981
957
|
if ( (*p) == 32 )
|
982
958
|
goto tr2;
|
983
959
|
goto st0;
|
@@ -997,7 +973,7 @@ case 46:
|
|
997
973
|
_test_eof14: cs = 14; goto _test_eof;
|
998
974
|
_test_eof15: cs = 15; goto _test_eof;
|
999
975
|
_test_eof16: cs = 16; goto _test_eof;
|
1000
|
-
|
976
|
+
_test_eof46: cs = 46; goto _test_eof;
|
1001
977
|
_test_eof17: cs = 17; goto _test_eof;
|
1002
978
|
_test_eof18: cs = 18; goto _test_eof;
|
1003
979
|
_test_eof19: cs = 19; goto _test_eof;
|
@@ -1027,13 +1003,12 @@ case 46:
|
|
1027
1003
|
_test_eof43: cs = 43; goto _test_eof;
|
1028
1004
|
_test_eof44: cs = 44; goto _test_eof;
|
1029
1005
|
_test_eof45: cs = 45; goto _test_eof;
|
1030
|
-
_test_eof46: cs = 46; goto _test_eof;
|
1031
1006
|
|
1032
1007
|
_test_eof: {}
|
1033
1008
|
_out: {}
|
1034
1009
|
}
|
1035
1010
|
|
1036
|
-
#line
|
1011
|
+
#line 115 "ext/puma_http11/http11_parser.rl"
|
1037
1012
|
|
1038
1013
|
if (!puma_parser_has_error(parser))
|
1039
1014
|
parser->cs = cs;
|