puma 3.0.0.rc1 → 5.0.0.beta1
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.txt → History.md} +703 -70
- data/LICENSE +23 -20
- data/README.md +173 -163
- data/docs/architecture.md +37 -0
- data/{DEPLOYMENT.md → docs/deployment.md} +28 -6
- data/docs/fork_worker.md +31 -0
- 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/jungle/README.md +13 -0
- data/docs/jungle/rc.d/README.md +74 -0
- data/docs/jungle/rc.d/puma +61 -0
- data/docs/jungle/rc.d/puma.conf +10 -0
- data/{tools → docs}/jungle/upstart/README.md +0 -0
- data/{tools → docs}/jungle/upstart/puma-manager.conf +0 -0
- data/{tools → docs}/jungle/upstart/puma.conf +1 -1
- data/docs/nginx.md +2 -2
- data/docs/plugins.md +38 -0
- data/docs/restart.md +41 -0
- data/docs/signals.md +57 -3
- data/docs/systemd.md +228 -0
- data/ext/puma_http11/PumaHttp11Service.java +2 -2
- data/ext/puma_http11/extconf.rb +16 -0
- data/ext/puma_http11/http11_parser.c +287 -468
- data/ext/puma_http11/http11_parser.h +1 -0
- data/ext/puma_http11/http11_parser.java.rl +21 -37
- data/ext/puma_http11/http11_parser.rl +10 -9
- data/ext/puma_http11/http11_parser_common.rl +4 -4
- data/ext/puma_http11/mini_ssl.c +159 -10
- data/ext/puma_http11/org/jruby/puma/Http11.java +108 -116
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +99 -132
- data/ext/puma_http11/org/jruby/puma/MiniSSL.java +30 -6
- data/ext/puma_http11/puma_http11.c +6 -38
- data/lib/puma.rb +25 -5
- data/lib/puma/accept_nonblock.rb +7 -1
- data/lib/puma/app/status.rb +53 -26
- data/lib/puma/binder.rb +150 -119
- data/lib/puma/cli.rb +56 -38
- data/lib/puma/client.rb +277 -80
- data/lib/puma/cluster.rb +326 -130
- data/lib/puma/commonlogger.rb +21 -20
- data/lib/puma/configuration.rb +160 -161
- data/lib/puma/const.rb +50 -47
- data/lib/puma/control_cli.rb +104 -63
- data/lib/puma/detect.rb +13 -1
- data/lib/puma/dsl.rb +463 -114
- data/lib/puma/events.rb +22 -13
- data/lib/puma/io_buffer.rb +9 -5
- data/lib/puma/jruby_restart.rb +2 -59
- data/lib/puma/launcher.rb +195 -105
- data/lib/puma/minissl.rb +110 -4
- data/lib/puma/minissl/context_builder.rb +76 -0
- data/lib/puma/null_io.rb +9 -14
- data/lib/puma/plugin.rb +32 -12
- data/lib/puma/plugin/tmp_restart.rb +19 -6
- data/lib/puma/rack/builder.rb +7 -5
- data/lib/puma/rack/urlmap.rb +11 -8
- data/lib/puma/rack_default.rb +2 -0
- data/lib/puma/reactor.rb +242 -32
- data/lib/puma/runner.rb +41 -30
- data/lib/puma/server.rb +265 -183
- data/lib/puma/single.rb +22 -63
- data/lib/puma/state_file.rb +9 -2
- data/lib/puma/thread_pool.rb +179 -68
- data/lib/puma/util.rb +3 -11
- data/lib/rack/handler/puma.rb +60 -11
- data/tools/Dockerfile +16 -0
- data/tools/trickletest.rb +1 -2
- metadata +35 -99
- data/COPYING +0 -55
- data/Gemfile +0 -13
- data/Manifest.txt +0 -79
- data/Rakefile +0 -158
- data/docs/config.md +0 -0
- data/ext/puma_http11/io_buffer.c +0 -155
- data/lib/puma/capistrano.rb +0 -94
- data/lib/puma/compat.rb +0 -18
- 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_18.rb +0 -56
- data/lib/puma/rack/backports/uri/common_192.rb +0 -52
- data/lib/puma/rack/backports/uri/common_193.rb +0 -29
- data/lib/puma/tcp_logger.rb +0 -32
- data/puma.gemspec +0 -52
- data/tools/jungle/README.md +0 -9
- data/tools/jungle/init.d/README.md +0 -54
- data/tools/jungle/init.d/puma +0 -394
- data/tools/jungle/init.d/run-puma +0 -3
data/docs/systemd.md
ADDED
@@ -0,0 +1,228 @@
|
|
1
|
+
# systemd
|
2
|
+
|
3
|
+
[systemd](https://www.freedesktop.org/wiki/Software/systemd/) is a
|
4
|
+
commonly available init system (PID 1) on many Linux distributions. It
|
5
|
+
offers process monitoring (including automatic restarts) and other
|
6
|
+
useful features for running Puma in production.
|
7
|
+
|
8
|
+
## Service Configuration
|
9
|
+
|
10
|
+
Below is a sample puma.service configuration file for systemd, which
|
11
|
+
can be copied or symlinked to /etc/systemd/system/puma.service, or if
|
12
|
+
desired, using an application or instance specific name.
|
13
|
+
|
14
|
+
Note that this uses the systemd preferred "simple" type where the
|
15
|
+
start command remains running in the foreground (does not fork and
|
16
|
+
exit).
|
17
|
+
|
18
|
+
~~~~ ini
|
19
|
+
[Unit]
|
20
|
+
Description=Puma HTTP Server
|
21
|
+
After=network.target
|
22
|
+
|
23
|
+
# Uncomment for socket activation (see below)
|
24
|
+
# Requires=puma.socket
|
25
|
+
|
26
|
+
[Service]
|
27
|
+
# Foreground process (do not use --daemon in ExecStart or config.rb)
|
28
|
+
Type=simple
|
29
|
+
|
30
|
+
# Preferably configure a non-privileged user
|
31
|
+
# User=
|
32
|
+
|
33
|
+
# The path to the your application code root directory.
|
34
|
+
# Also replace the "<YOUR_APP_PATH>" place holders below with this path.
|
35
|
+
# Example /home/username/myapp
|
36
|
+
WorkingDirectory=<YOUR_APP_PATH>
|
37
|
+
|
38
|
+
# Helpful for debugging socket activation, etc.
|
39
|
+
# Environment=PUMA_DEBUG=1
|
40
|
+
|
41
|
+
# SystemD will not run puma even if it is in your path. You must specify
|
42
|
+
# an absolute URL to puma. For example /usr/local/bin/puma
|
43
|
+
# Alternatively, create a binstub with `bundle binstubs puma --path ./sbin` in the WorkingDirectory
|
44
|
+
ExecStart=/<FULLPATH>/bin/puma -C <YOUR_APP_PATH>/puma.rb
|
45
|
+
|
46
|
+
# Variant: Rails start.
|
47
|
+
# ExecStart=/<FULLPATH>/bin/puma -C <YOUR_APP_PATH>/config/puma.rb ../config.ru
|
48
|
+
|
49
|
+
# Variant: Use `bundle exec --keep-file-descriptors puma` instead of binstub
|
50
|
+
# Variant: Specify directives inline.
|
51
|
+
# ExecStart=/<FULLPATH>/puma -b tcp://0.0.0.0:9292 -b ssl://0.0.0.0:9293?key=key.pem&cert=cert.pem
|
52
|
+
|
53
|
+
|
54
|
+
Restart=always
|
55
|
+
|
56
|
+
[Install]
|
57
|
+
WantedBy=multi-user.target
|
58
|
+
~~~~
|
59
|
+
|
60
|
+
See [systemd.exec](https://www.freedesktop.org/software/systemd/man/systemd.exec.html)
|
61
|
+
for additional details.
|
62
|
+
|
63
|
+
## Socket Activation
|
64
|
+
|
65
|
+
systemd and puma also support socket activation, where systemd opens
|
66
|
+
the listening socket(s) in advance and provides them to the puma
|
67
|
+
master process on startup. Among other advantages, this keeps
|
68
|
+
listening sockets open across puma restarts and achieves graceful
|
69
|
+
restarts, including when upgraded puma, and is compatible with both
|
70
|
+
clustered mode and application preload.
|
71
|
+
|
72
|
+
**Note:** Any wrapper scripts which `exec`, or other indirections in
|
73
|
+
`ExecStart`, may result in activated socket file descriptors being closed
|
74
|
+
before they reach the puma master process. For example, if using `bundle exec`,
|
75
|
+
pass the `--keep-file-descriptors` flag. `bundle exec` can be avoided by using a
|
76
|
+
`puma` executable generated by `bundle binstubs puma`. This is tracked in
|
77
|
+
[#1499].
|
78
|
+
|
79
|
+
**Note:** Socket activation doesn't currently work on jruby. This is
|
80
|
+
tracked in [#1367].
|
81
|
+
|
82
|
+
To use socket activation, configure one or more `ListenStream` sockets
|
83
|
+
in a companion `*.socket` unit file. Also uncomment the associated
|
84
|
+
`Requires` directive for the socket unit in the service file (see
|
85
|
+
above.) Here is a sample puma.socket, matching the ports used in the
|
86
|
+
above puma.service:
|
87
|
+
|
88
|
+
~~~~ ini
|
89
|
+
[Unit]
|
90
|
+
Description=Puma HTTP Server Accept Sockets
|
91
|
+
|
92
|
+
[Socket]
|
93
|
+
ListenStream=0.0.0.0:9292
|
94
|
+
ListenStream=0.0.0.0:9293
|
95
|
+
|
96
|
+
# AF_UNIX domain socket
|
97
|
+
# SocketUser, SocketGroup, etc. may be needed for Unix domain sockets
|
98
|
+
# ListenStream=/run/puma.sock
|
99
|
+
|
100
|
+
# Socket options matching Puma defaults
|
101
|
+
NoDelay=true
|
102
|
+
ReusePort=true
|
103
|
+
Backlog=1024
|
104
|
+
|
105
|
+
[Install]
|
106
|
+
WantedBy=sockets.target
|
107
|
+
~~~~
|
108
|
+
|
109
|
+
See [systemd.socket](https://www.freedesktop.org/software/systemd/man/systemd.socket.html)
|
110
|
+
for additional configuration details.
|
111
|
+
|
112
|
+
Note that the above configurations will work with Puma in either
|
113
|
+
single process or cluster mode.
|
114
|
+
|
115
|
+
### Sockets and symlinks
|
116
|
+
|
117
|
+
When using releases folders, you should set the socket path using the
|
118
|
+
shared folder path (ex. `/srv/projet/shared/tmp/puma.sock`), not the
|
119
|
+
release folder path (`/srv/projet/releases/1234/tmp/puma.sock`).
|
120
|
+
|
121
|
+
Puma will detect the release path socket as different than the one provided by
|
122
|
+
systemd and attempt to bind it again, resulting in the exception
|
123
|
+
`There is already a server bound to:`.
|
124
|
+
|
125
|
+
## Usage
|
126
|
+
|
127
|
+
Without socket activation, use `systemctl` as root (e.g. via `sudo`) as
|
128
|
+
with other system services:
|
129
|
+
|
130
|
+
~~~~ sh
|
131
|
+
# After installing or making changes to puma.service
|
132
|
+
systemctl daemon-reload
|
133
|
+
|
134
|
+
# Enable so it starts on boot
|
135
|
+
systemctl enable puma.service
|
136
|
+
|
137
|
+
# Initial start up.
|
138
|
+
systemctl start puma.service
|
139
|
+
|
140
|
+
# Check status
|
141
|
+
systemctl status puma.service
|
142
|
+
|
143
|
+
# A normal restart. Warning: listeners sockets will be closed
|
144
|
+
# while a new puma process initializes.
|
145
|
+
systemctl restart puma.service
|
146
|
+
~~~~
|
147
|
+
|
148
|
+
With socket activation, several but not all of these commands should
|
149
|
+
be run for both socket and service:
|
150
|
+
|
151
|
+
~~~~ sh
|
152
|
+
# After installing or making changes to either puma.socket or
|
153
|
+
# puma.service.
|
154
|
+
systemctl daemon-reload
|
155
|
+
|
156
|
+
# Enable both socket and service so they start on boot. Alternatively
|
157
|
+
# you could leave puma.service disabled and systemd will start it on
|
158
|
+
# first use (with startup lag on first request)
|
159
|
+
systemctl enable puma.socket puma.service
|
160
|
+
|
161
|
+
# Initial start up. The Requires directive (see above) ensures the
|
162
|
+
# socket is started before the service.
|
163
|
+
systemctl start puma.socket puma.service
|
164
|
+
|
165
|
+
# Check status of both socket and service.
|
166
|
+
systemctl status puma.socket puma.service
|
167
|
+
|
168
|
+
# A "hot" restart, with systemd keeping puma.socket listening and
|
169
|
+
# providing to the new puma (master) instance.
|
170
|
+
systemctl restart puma.service
|
171
|
+
|
172
|
+
# A normal restart, needed to handle changes to
|
173
|
+
# puma.socket, such as changing the ListenStream ports. Note
|
174
|
+
# daemon-reload (above) should be run first.
|
175
|
+
systemctl restart puma.socket puma.service
|
176
|
+
~~~~
|
177
|
+
|
178
|
+
Here is sample output from `systemctl status` with both service and
|
179
|
+
socket running:
|
180
|
+
|
181
|
+
~~~~
|
182
|
+
● puma.socket - Puma HTTP Server Accept Sockets
|
183
|
+
Loaded: loaded (/etc/systemd/system/puma.socket; enabled; vendor preset: enabled)
|
184
|
+
Active: active (running) since Thu 2016-04-07 08:40:19 PDT; 1h 2min ago
|
185
|
+
Listen: 0.0.0.0:9233 (Stream)
|
186
|
+
0.0.0.0:9234 (Stream)
|
187
|
+
|
188
|
+
Apr 07 08:40:19 hx systemd[874]: Listening on Puma HTTP Server Accept Sockets.
|
189
|
+
|
190
|
+
● puma.service - Puma HTTP Server
|
191
|
+
Loaded: loaded (/etc/systemd/system/puma.service; enabled; vendor preset: enabled)
|
192
|
+
Active: active (running) since Thu 2016-04-07 08:40:19 PDT; 1h 2min ago
|
193
|
+
Main PID: 28320 (ruby)
|
194
|
+
CGroup: /system.slice/puma.service
|
195
|
+
├─28320 puma 3.3.0 (tcp://0.0.0.0:9233,ssl://0.0.0.0:9234?key=key.pem&cert=cert.pem) [app]
|
196
|
+
├─28323 puma: cluster worker 0: 28320 [app]
|
197
|
+
└─28327 puma: cluster worker 1: 28320 [app]
|
198
|
+
|
199
|
+
Apr 07 08:40:19 hx puma[28320]: Puma starting in cluster mode...
|
200
|
+
Apr 07 08:40:19 hx puma[28320]: * Version 3.3.0 (ruby 2.2.4-p230), codename: Jovial Platypus
|
201
|
+
Apr 07 08:40:19 hx puma[28320]: * Min threads: 0, max threads: 16
|
202
|
+
Apr 07 08:40:19 hx puma[28320]: * Environment: production
|
203
|
+
Apr 07 08:40:19 hx puma[28320]: * Process workers: 2
|
204
|
+
Apr 07 08:40:19 hx puma[28320]: * Phased restart available
|
205
|
+
Apr 07 08:40:19 hx puma[28320]: * Activated tcp://0.0.0.0:9233
|
206
|
+
Apr 07 08:40:19 hx puma[28320]: * Activated ssl://0.0.0.0:9234?key=key.pem&cert=cert.pem
|
207
|
+
Apr 07 08:40:19 hx puma[28320]: Use Ctrl-C to stop
|
208
|
+
~~~~
|
209
|
+
|
210
|
+
### capistrano3-puma
|
211
|
+
|
212
|
+
By default,
|
213
|
+
[capistrano3-puma](https://github.com/seuros/capistrano-puma) uses
|
214
|
+
`pumactl` for deployment restarts, outside of systemd. To learn the
|
215
|
+
exact commands that this tool would use for `ExecStart` and
|
216
|
+
`ExecStop`, use the following `cap` commands in dry-run mode, and
|
217
|
+
update from the above forking service configuration accordingly. Note
|
218
|
+
also that the configured `User` should likely be the same as the
|
219
|
+
capistrano3-puma `:puma_user` option.
|
220
|
+
|
221
|
+
~~~~ sh
|
222
|
+
stage=production # or different stage, as needed
|
223
|
+
cap $stage puma:start --dry-run
|
224
|
+
cap $stage puma:stop --dry-run
|
225
|
+
~~~~
|
226
|
+
|
227
|
+
[Restart]: https://www.freedesktop.org/software/systemd/man/systemd.service.html#Restart=
|
228
|
+
[#1367]: https://github.com/puma/puma/issues/1367
|
@@ -1,14 +1,14 @@
|
|
1
1
|
package puma;
|
2
2
|
|
3
3
|
import java.io.IOException;
|
4
|
-
|
4
|
+
|
5
5
|
import org.jruby.Ruby;
|
6
6
|
import org.jruby.runtime.load.BasicLibraryService;
|
7
7
|
|
8
8
|
import org.jruby.puma.Http11;
|
9
9
|
import org.jruby.puma.MiniSSL;
|
10
10
|
|
11
|
-
public class PumaHttp11Service implements BasicLibraryService {
|
11
|
+
public class PumaHttp11Service implements BasicLibraryService {
|
12
12
|
public boolean basicLoad(final Ruby runtime) throws IOException {
|
13
13
|
Http11.createHttp11(runtime);
|
14
14
|
MiniSSL.createMiniSSL(runtime);
|
data/ext/puma_http11/extconf.rb
CHANGED
@@ -2,11 +2,27 @@ require 'mkmf'
|
|
2
2
|
|
3
3
|
dir_config("puma_http11")
|
4
4
|
|
5
|
+
if $mingw && RUBY_VERSION >= '2.4'
|
6
|
+
append_cflags '-fstack-protector-strong -D_FORTIFY_SOURCE=2'
|
7
|
+
append_ldflags '-fstack-protector-strong -l:libssp.a'
|
8
|
+
have_library 'ssp'
|
9
|
+
end
|
10
|
+
|
5
11
|
unless ENV["DISABLE_SSL"]
|
12
|
+
dir_config("openssl")
|
13
|
+
|
6
14
|
if %w'crypto libeay32'.find {|crypto| have_library(crypto, 'BIO_read')} and
|
7
15
|
%w'ssl ssleay32'.find {|ssl| have_library(ssl, 'SSL_CTX_new')}
|
8
16
|
|
9
17
|
have_header "openssl/bio.h"
|
18
|
+
|
19
|
+
# below is yes for 1.0.2 & later
|
20
|
+
have_func "DTLS_method" , "openssl/ssl.h"
|
21
|
+
|
22
|
+
# below are yes for 1.1.0 & later, may need to check func rather than macro
|
23
|
+
# with versions after 1.1.1
|
24
|
+
have_func "TLS_server_method" , "openssl/ssl.h"
|
25
|
+
have_macro "SSL_CTX_set_min_proto_version", "openssl/ssl.h"
|
10
26
|
end
|
11
27
|
end
|
12
28
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
|
2
|
-
#line 1 "ext/
|
2
|
+
#line 1 "ext/puma_http11/http11_parser.rl"
|
3
3
|
/**
|
4
4
|
* Copyright (c) 2005 Zed A. Shaw
|
5
5
|
* You can redistribute it and/or modify it under the same terms as Ruby.
|
6
|
+
* License 3-clause BSD
|
6
7
|
*/
|
7
8
|
#include "http11_parser.h"
|
8
9
|
#include <stdio.h>
|
@@ -30,30 +31,30 @@ static void snake_upcase_char(char *c)
|
|
30
31
|
/** Machine **/
|
31
32
|
|
32
33
|
|
33
|
-
#line
|
34
|
+
#line 79 "ext/puma_http11/http11_parser.rl"
|
34
35
|
|
35
36
|
|
36
37
|
/** Data **/
|
37
38
|
|
38
|
-
#line
|
39
|
+
#line 40 "ext/puma_http11/http11_parser.c"
|
39
40
|
static const int puma_parser_start = 1;
|
40
|
-
static const int puma_parser_first_final =
|
41
|
+
static const int puma_parser_first_final = 46;
|
41
42
|
static const int puma_parser_error = 0;
|
42
43
|
|
43
44
|
static const int puma_parser_en_main = 1;
|
44
45
|
|
45
46
|
|
46
|
-
#line
|
47
|
+
#line 83 "ext/puma_http11/http11_parser.rl"
|
47
48
|
|
48
49
|
int puma_parser_init(puma_parser *parser) {
|
49
50
|
int cs = 0;
|
50
51
|
|
51
|
-
#line
|
52
|
+
#line 53 "ext/puma_http11/http11_parser.c"
|
52
53
|
{
|
53
54
|
cs = puma_parser_start;
|
54
55
|
}
|
55
56
|
|
56
|
-
#line
|
57
|
+
#line 87 "ext/puma_http11/http11_parser.rl"
|
57
58
|
parser->cs = cs;
|
58
59
|
parser->body_start = 0;
|
59
60
|
parser->content_len = 0;
|
@@ -79,10 +80,10 @@ size_t puma_parser_execute(puma_parser *parser, const char *buffer, size_t len,
|
|
79
80
|
pe = buffer+len;
|
80
81
|
|
81
82
|
/* assert(*pe == '\0' && "pointer does not end on NUL"); */
|
82
|
-
assert(pe - p == len - off && "pointers aren't same distance");
|
83
|
+
assert((size_t) (pe - p) == len - off && "pointers aren't same distance");
|
83
84
|
|
84
85
|
|
85
|
-
#line
|
86
|
+
#line 87 "ext/puma_http11/http11_parser.c"
|
86
87
|
{
|
87
88
|
if ( p == pe )
|
88
89
|
goto _test_eof;
|
@@ -106,31 +107,31 @@ st0:
|
|
106
107
|
cs = 0;
|
107
108
|
goto _out;
|
108
109
|
tr0:
|
109
|
-
#line
|
110
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
110
111
|
{ MARK(mark, p); }
|
111
112
|
goto st2;
|
112
113
|
st2:
|
113
114
|
if ( ++p == pe )
|
114
115
|
goto _test_eof2;
|
115
116
|
case 2:
|
116
|
-
#line
|
117
|
+
#line 118 "ext/puma_http11/http11_parser.c"
|
117
118
|
switch( (*p) ) {
|
118
119
|
case 32: goto tr2;
|
119
|
-
case 36: goto
|
120
|
-
case 95: goto
|
120
|
+
case 36: goto st27;
|
121
|
+
case 95: goto st27;
|
121
122
|
}
|
122
123
|
if ( (*p) < 48 ) {
|
123
124
|
if ( 45 <= (*p) && (*p) <= 46 )
|
124
|
-
goto
|
125
|
+
goto st27;
|
125
126
|
} else if ( (*p) > 57 ) {
|
126
127
|
if ( 65 <= (*p) && (*p) <= 90 )
|
127
|
-
goto
|
128
|
+
goto st27;
|
128
129
|
} else
|
129
|
-
goto
|
130
|
+
goto st27;
|
130
131
|
goto st0;
|
131
132
|
tr2:
|
132
|
-
#line
|
133
|
-
{
|
133
|
+
#line 48 "ext/puma_http11/http11_parser.rl"
|
134
|
+
{
|
134
135
|
parser->request_method(parser, PTR_TO(mark), LEN(mark, p));
|
135
136
|
}
|
136
137
|
goto st3;
|
@@ -138,7 +139,7 @@ st3:
|
|
138
139
|
if ( ++p == pe )
|
139
140
|
goto _test_eof3;
|
140
141
|
case 3:
|
141
|
-
#line
|
142
|
+
#line 143 "ext/puma_http11/http11_parser.c"
|
142
143
|
switch( (*p) ) {
|
143
144
|
case 42: goto tr4;
|
144
145
|
case 43: goto tr5;
|
@@ -155,68 +156,68 @@ case 3:
|
|
155
156
|
goto tr5;
|
156
157
|
goto st0;
|
157
158
|
tr4:
|
158
|
-
#line
|
159
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
159
160
|
{ MARK(mark, p); }
|
160
161
|
goto st4;
|
161
162
|
st4:
|
162
163
|
if ( ++p == pe )
|
163
164
|
goto _test_eof4;
|
164
165
|
case 4:
|
165
|
-
#line
|
166
|
+
#line 167 "ext/puma_http11/http11_parser.c"
|
166
167
|
switch( (*p) ) {
|
167
168
|
case 32: goto tr8;
|
168
169
|
case 35: goto tr9;
|
169
170
|
}
|
170
171
|
goto st0;
|
171
172
|
tr8:
|
172
|
-
#line
|
173
|
-
{
|
173
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
174
|
+
{
|
174
175
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
175
176
|
}
|
176
177
|
goto st5;
|
177
178
|
tr31:
|
178
|
-
#line
|
179
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
179
180
|
{ MARK(mark, p); }
|
180
|
-
#line
|
181
|
+
#line 54 "ext/puma_http11/http11_parser.rl"
|
181
182
|
{
|
182
183
|
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
|
183
184
|
}
|
184
185
|
goto st5;
|
185
|
-
|
186
|
-
#line
|
186
|
+
tr33:
|
187
|
+
#line 54 "ext/puma_http11/http11_parser.rl"
|
187
188
|
{
|
188
189
|
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
|
189
190
|
}
|
190
191
|
goto st5;
|
191
|
-
|
192
|
-
#line
|
192
|
+
tr37:
|
193
|
+
#line 67 "ext/puma_http11/http11_parser.rl"
|
193
194
|
{
|
194
195
|
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
195
196
|
}
|
196
|
-
#line
|
197
|
-
{
|
197
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
198
|
+
{
|
198
199
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
199
200
|
}
|
200
201
|
goto st5;
|
201
|
-
|
202
|
-
#line
|
202
|
+
tr41:
|
203
|
+
#line 58 "ext/puma_http11/http11_parser.rl"
|
203
204
|
{ MARK(query_start, p); }
|
204
|
-
#line
|
205
|
-
{
|
205
|
+
#line 59 "ext/puma_http11/http11_parser.rl"
|
206
|
+
{
|
206
207
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
207
208
|
}
|
208
|
-
#line
|
209
|
-
{
|
209
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
210
|
+
{
|
210
211
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
211
212
|
}
|
212
213
|
goto st5;
|
213
|
-
|
214
|
-
#line
|
215
|
-
{
|
214
|
+
tr44:
|
215
|
+
#line 59 "ext/puma_http11/http11_parser.rl"
|
216
|
+
{
|
216
217
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
217
218
|
}
|
218
|
-
#line
|
219
|
-
{
|
219
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
220
|
+
{
|
220
221
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
221
222
|
}
|
222
223
|
goto st5;
|
@@ -224,19 +225,19 @@ st5:
|
|
224
225
|
if ( ++p == pe )
|
225
226
|
goto _test_eof5;
|
226
227
|
case 5:
|
227
|
-
#line
|
228
|
+
#line 229 "ext/puma_http11/http11_parser.c"
|
228
229
|
if ( (*p) == 72 )
|
229
230
|
goto tr10;
|
230
231
|
goto st0;
|
231
232
|
tr10:
|
232
|
-
#line
|
233
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
233
234
|
{ MARK(mark, p); }
|
234
235
|
goto st6;
|
235
236
|
st6:
|
236
237
|
if ( ++p == pe )
|
237
238
|
goto _test_eof6;
|
238
239
|
case 6:
|
239
|
-
#line
|
240
|
+
#line 241 "ext/puma_http11/http11_parser.c"
|
240
241
|
if ( (*p) == 84 )
|
241
242
|
goto st7;
|
242
243
|
goto st0;
|
@@ -294,21 +295,21 @@ case 13:
|
|
294
295
|
goto st13;
|
295
296
|
goto st0;
|
296
297
|
tr18:
|
297
|
-
#line
|
298
|
-
{
|
298
|
+
#line 63 "ext/puma_http11/http11_parser.rl"
|
299
|
+
{
|
299
300
|
parser->http_version(parser, PTR_TO(mark), LEN(mark, p));
|
300
301
|
}
|
301
302
|
goto st14;
|
302
303
|
tr26:
|
303
|
-
#line
|
304
|
+
#line 44 "ext/puma_http11/http11_parser.rl"
|
304
305
|
{ MARK(mark, p); }
|
305
|
-
#line
|
306
|
+
#line 45 "ext/puma_http11/http11_parser.rl"
|
306
307
|
{
|
307
308
|
parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
308
309
|
}
|
309
310
|
goto st14;
|
310
311
|
tr29:
|
311
|
-
#line
|
312
|
+
#line 45 "ext/puma_http11/http11_parser.rl"
|
312
313
|
{
|
313
314
|
parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
314
315
|
}
|
@@ -317,7 +318,7 @@ st14:
|
|
317
318
|
if ( ++p == pe )
|
318
319
|
goto _test_eof14;
|
319
320
|
case 14:
|
320
|
-
#line
|
321
|
+
#line 322 "ext/puma_http11/http11_parser.c"
|
321
322
|
if ( (*p) == 10 )
|
322
323
|
goto st15;
|
323
324
|
goto st0;
|
@@ -357,34 +358,34 @@ case 16:
|
|
357
358
|
goto tr22;
|
358
359
|
goto st0;
|
359
360
|
tr22:
|
360
|
-
#line
|
361
|
-
{
|
362
|
-
parser->body_start = p - buffer + 1;
|
361
|
+
#line 71 "ext/puma_http11/http11_parser.rl"
|
362
|
+
{
|
363
|
+
parser->body_start = p - buffer + 1;
|
363
364
|
parser->header_done(parser, p + 1, pe - p - 1);
|
364
|
-
{p++; cs =
|
365
|
+
{p++; cs = 46; goto _out;}
|
365
366
|
}
|
366
|
-
goto
|
367
|
-
|
367
|
+
goto st46;
|
368
|
+
st46:
|
368
369
|
if ( ++p == pe )
|
369
|
-
goto
|
370
|
-
case
|
371
|
-
#line
|
370
|
+
goto _test_eof46;
|
371
|
+
case 46:
|
372
|
+
#line 373 "ext/puma_http11/http11_parser.c"
|
372
373
|
goto st0;
|
373
374
|
tr21:
|
374
|
-
#line
|
375
|
+
#line 38 "ext/puma_http11/http11_parser.rl"
|
375
376
|
{ MARK(field_start, p); }
|
376
|
-
#line
|
377
|
+
#line 39 "ext/puma_http11/http11_parser.rl"
|
377
378
|
{ snake_upcase_char((char *)p); }
|
378
379
|
goto st17;
|
379
380
|
tr23:
|
380
|
-
#line
|
381
|
+
#line 39 "ext/puma_http11/http11_parser.rl"
|
381
382
|
{ snake_upcase_char((char *)p); }
|
382
383
|
goto st17;
|
383
384
|
st17:
|
384
385
|
if ( ++p == pe )
|
385
386
|
goto _test_eof17;
|
386
387
|
case 17:
|
387
|
-
#line
|
388
|
+
#line 389 "ext/puma_http11/http11_parser.c"
|
388
389
|
switch( (*p) ) {
|
389
390
|
case 33: goto tr23;
|
390
391
|
case 58: goto tr24;
|
@@ -410,72 +411,72 @@ case 17:
|
|
410
411
|
goto tr23;
|
411
412
|
goto st0;
|
412
413
|
tr24:
|
413
|
-
#line
|
414
|
-
{
|
414
|
+
#line 40 "ext/puma_http11/http11_parser.rl"
|
415
|
+
{
|
415
416
|
parser->field_len = LEN(field_start, p);
|
416
417
|
}
|
417
418
|
goto st18;
|
418
419
|
tr27:
|
419
|
-
#line
|
420
|
+
#line 44 "ext/puma_http11/http11_parser.rl"
|
420
421
|
{ MARK(mark, p); }
|
421
422
|
goto st18;
|
422
423
|
st18:
|
423
424
|
if ( ++p == pe )
|
424
425
|
goto _test_eof18;
|
425
426
|
case 18:
|
426
|
-
#line
|
427
|
+
#line 428 "ext/puma_http11/http11_parser.c"
|
427
428
|
switch( (*p) ) {
|
428
429
|
case 13: goto tr26;
|
429
430
|
case 32: goto tr27;
|
430
431
|
}
|
431
432
|
goto tr25;
|
432
433
|
tr25:
|
433
|
-
#line
|
434
|
+
#line 44 "ext/puma_http11/http11_parser.rl"
|
434
435
|
{ MARK(mark, p); }
|
435
436
|
goto st19;
|
436
437
|
st19:
|
437
438
|
if ( ++p == pe )
|
438
439
|
goto _test_eof19;
|
439
440
|
case 19:
|
440
|
-
#line
|
441
|
+
#line 442 "ext/puma_http11/http11_parser.c"
|
441
442
|
if ( (*p) == 13 )
|
442
443
|
goto tr29;
|
443
444
|
goto st19;
|
444
445
|
tr9:
|
445
|
-
#line
|
446
|
-
{
|
446
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
447
|
+
{
|
447
448
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
448
449
|
}
|
449
450
|
goto st20;
|
450
|
-
|
451
|
-
#line
|
451
|
+
tr38:
|
452
|
+
#line 67 "ext/puma_http11/http11_parser.rl"
|
452
453
|
{
|
453
454
|
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
454
455
|
}
|
455
|
-
#line
|
456
|
-
{
|
456
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
457
|
+
{
|
457
458
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
458
459
|
}
|
459
460
|
goto st20;
|
460
|
-
|
461
|
-
#line
|
461
|
+
tr42:
|
462
|
+
#line 58 "ext/puma_http11/http11_parser.rl"
|
462
463
|
{ MARK(query_start, p); }
|
463
|
-
#line
|
464
|
-
{
|
464
|
+
#line 59 "ext/puma_http11/http11_parser.rl"
|
465
|
+
{
|
465
466
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
466
467
|
}
|
467
|
-
#line
|
468
|
-
{
|
468
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
469
|
+
{
|
469
470
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
470
471
|
}
|
471
472
|
goto st20;
|
472
|
-
|
473
|
-
#line
|
474
|
-
{
|
473
|
+
tr45:
|
474
|
+
#line 59 "ext/puma_http11/http11_parser.rl"
|
475
|
+
{
|
475
476
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
476
477
|
}
|
477
|
-
#line
|
478
|
-
{
|
478
|
+
#line 51 "ext/puma_http11/http11_parser.rl"
|
479
|
+
{
|
479
480
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
480
481
|
}
|
481
482
|
goto st20;
|
@@ -483,10 +484,9 @@ st20:
|
|
483
484
|
if ( ++p == pe )
|
484
485
|
goto _test_eof20;
|
485
486
|
case 20:
|
486
|
-
#line
|
487
|
+
#line 488 "ext/puma_http11/http11_parser.c"
|
487
488
|
switch( (*p) ) {
|
488
489
|
case 32: goto tr31;
|
489
|
-
case 37: goto tr32;
|
490
490
|
case 60: goto st0;
|
491
491
|
case 62: goto st0;
|
492
492
|
case 127: goto st0;
|
@@ -498,17 +498,16 @@ 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 509 "ext/
|
508
|
+
#line 509 "ext/puma_http11/http11_parser.c"
|
509
509
|
switch( (*p) ) {
|
510
|
-
case 32: goto
|
511
|
-
case 37: goto st22;
|
510
|
+
case 32: goto tr33;
|
512
511
|
case 60: goto st0;
|
513
512
|
case 62: goto st0;
|
514
513
|
case 127: goto st0;
|
@@ -519,611 +518,442 @@ case 21:
|
|
519
518
|
} else if ( (*p) >= 0 )
|
520
519
|
goto st0;
|
521
520
|
goto st21;
|
522
|
-
|
523
|
-
#line
|
521
|
+
tr5:
|
522
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
524
523
|
{ MARK(mark, p); }
|
525
524
|
goto st22;
|
526
525
|
st22:
|
527
526
|
if ( ++p == pe )
|
528
527
|
goto _test_eof22;
|
529
528
|
case 22:
|
530
|
-
#line
|
531
|
-
if ( (*p) < 65 ) {
|
532
|
-
if ( 48 <= (*p) && (*p) <= 57 )
|
533
|
-
goto st23;
|
534
|
-
} else if ( (*p) > 70 ) {
|
535
|
-
if ( 97 <= (*p) && (*p) <= 102 )
|
536
|
-
goto st23;
|
537
|
-
} else
|
538
|
-
goto st23;
|
539
|
-
goto st0;
|
540
|
-
st23:
|
541
|
-
if ( ++p == pe )
|
542
|
-
goto _test_eof23;
|
543
|
-
case 23:
|
544
|
-
if ( (*p) < 65 ) {
|
545
|
-
if ( 48 <= (*p) && (*p) <= 57 )
|
546
|
-
goto st21;
|
547
|
-
} else if ( (*p) > 70 ) {
|
548
|
-
if ( 97 <= (*p) && (*p) <= 102 )
|
549
|
-
goto st21;
|
550
|
-
} else
|
551
|
-
goto st21;
|
552
|
-
goto st0;
|
553
|
-
tr5:
|
554
|
-
#line 34 "ext/http11/http11_parser.rl"
|
555
|
-
{ MARK(mark, p); }
|
556
|
-
goto st24;
|
557
|
-
st24:
|
558
|
-
if ( ++p == pe )
|
559
|
-
goto _test_eof24;
|
560
|
-
case 24:
|
561
|
-
#line 562 "ext/http11/http11_parser.c"
|
529
|
+
#line 530 "ext/puma_http11/http11_parser.c"
|
562
530
|
switch( (*p) ) {
|
563
|
-
case 43: goto
|
564
|
-
case 58: goto
|
531
|
+
case 43: goto st22;
|
532
|
+
case 58: goto st23;
|
565
533
|
}
|
566
534
|
if ( (*p) < 48 ) {
|
567
535
|
if ( 45 <= (*p) && (*p) <= 46 )
|
568
|
-
goto
|
536
|
+
goto st22;
|
569
537
|
} else if ( (*p) > 57 ) {
|
570
538
|
if ( (*p) > 90 ) {
|
571
539
|
if ( 97 <= (*p) && (*p) <= 122 )
|
572
|
-
goto
|
540
|
+
goto st22;
|
573
541
|
} else if ( (*p) >= 65 )
|
574
|
-
goto
|
542
|
+
goto st22;
|
575
543
|
} else
|
576
|
-
goto
|
544
|
+
goto st22;
|
577
545
|
goto st0;
|
578
546
|
tr7:
|
579
|
-
#line
|
547
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
580
548
|
{ MARK(mark, p); }
|
581
|
-
goto
|
582
|
-
|
549
|
+
goto st23;
|
550
|
+
st23:
|
583
551
|
if ( ++p == pe )
|
584
|
-
goto
|
585
|
-
case
|
586
|
-
#line
|
552
|
+
goto _test_eof23;
|
553
|
+
case 23:
|
554
|
+
#line 555 "ext/puma_http11/http11_parser.c"
|
587
555
|
switch( (*p) ) {
|
588
556
|
case 32: goto tr8;
|
589
557
|
case 34: goto st0;
|
590
558
|
case 35: goto tr9;
|
591
|
-
case 37: goto st26;
|
592
559
|
case 60: goto st0;
|
593
560
|
case 62: goto st0;
|
594
561
|
case 127: goto st0;
|
595
562
|
}
|
596
563
|
if ( 0 <= (*p) && (*p) <= 31 )
|
597
564
|
goto st0;
|
598
|
-
goto
|
599
|
-
st26:
|
600
|
-
if ( ++p == pe )
|
601
|
-
goto _test_eof26;
|
602
|
-
case 26:
|
603
|
-
if ( (*p) < 65 ) {
|
604
|
-
if ( 48 <= (*p) && (*p) <= 57 )
|
605
|
-
goto st27;
|
606
|
-
} else if ( (*p) > 70 ) {
|
607
|
-
if ( 97 <= (*p) && (*p) <= 102 )
|
608
|
-
goto st27;
|
609
|
-
} else
|
610
|
-
goto st27;
|
611
|
-
goto st0;
|
612
|
-
st27:
|
613
|
-
if ( ++p == pe )
|
614
|
-
goto _test_eof27;
|
615
|
-
case 27:
|
616
|
-
if ( (*p) < 65 ) {
|
617
|
-
if ( 48 <= (*p) && (*p) <= 57 )
|
618
|
-
goto st25;
|
619
|
-
} else if ( (*p) > 70 ) {
|
620
|
-
if ( 97 <= (*p) && (*p) <= 102 )
|
621
|
-
goto st25;
|
622
|
-
} else
|
623
|
-
goto st25;
|
624
|
-
goto st0;
|
565
|
+
goto st23;
|
625
566
|
tr6:
|
626
|
-
#line
|
567
|
+
#line 35 "ext/puma_http11/http11_parser.rl"
|
627
568
|
{ MARK(mark, p); }
|
628
|
-
goto
|
629
|
-
|
630
|
-
if ( ++p == pe )
|
631
|
-
goto _test_eof28;
|
632
|
-
case 28:
|
633
|
-
#line 634 "ext/http11/http11_parser.c"
|
634
|
-
switch( (*p) ) {
|
635
|
-
case 32: goto tr42;
|
636
|
-
case 34: goto st0;
|
637
|
-
case 35: goto tr43;
|
638
|
-
case 37: goto st29;
|
639
|
-
case 59: goto tr45;
|
640
|
-
case 60: goto st0;
|
641
|
-
case 62: goto st0;
|
642
|
-
case 63: goto tr46;
|
643
|
-
case 127: goto st0;
|
644
|
-
}
|
645
|
-
if ( 0 <= (*p) && (*p) <= 31 )
|
646
|
-
goto st0;
|
647
|
-
goto st28;
|
648
|
-
st29:
|
649
|
-
if ( ++p == pe )
|
650
|
-
goto _test_eof29;
|
651
|
-
case 29:
|
652
|
-
if ( (*p) < 65 ) {
|
653
|
-
if ( 48 <= (*p) && (*p) <= 57 )
|
654
|
-
goto st30;
|
655
|
-
} else if ( (*p) > 70 ) {
|
656
|
-
if ( 97 <= (*p) && (*p) <= 102 )
|
657
|
-
goto st30;
|
658
|
-
} else
|
659
|
-
goto st30;
|
660
|
-
goto st0;
|
661
|
-
st30:
|
662
|
-
if ( ++p == pe )
|
663
|
-
goto _test_eof30;
|
664
|
-
case 30:
|
665
|
-
if ( (*p) < 65 ) {
|
666
|
-
if ( 48 <= (*p) && (*p) <= 57 )
|
667
|
-
goto st28;
|
668
|
-
} else if ( (*p) > 70 ) {
|
669
|
-
if ( 97 <= (*p) && (*p) <= 102 )
|
670
|
-
goto st28;
|
671
|
-
} else
|
672
|
-
goto st28;
|
673
|
-
goto st0;
|
674
|
-
tr45:
|
675
|
-
#line 66 "ext/http11/http11_parser.rl"
|
676
|
-
{
|
677
|
-
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
678
|
-
}
|
679
|
-
goto st31;
|
680
|
-
st31:
|
569
|
+
goto st24;
|
570
|
+
st24:
|
681
571
|
if ( ++p == pe )
|
682
|
-
goto
|
683
|
-
case
|
684
|
-
#line
|
572
|
+
goto _test_eof24;
|
573
|
+
case 24:
|
574
|
+
#line 575 "ext/puma_http11/http11_parser.c"
|
685
575
|
switch( (*p) ) {
|
686
|
-
case 32: goto
|
576
|
+
case 32: goto tr37;
|
687
577
|
case 34: goto st0;
|
688
|
-
case 35: goto
|
689
|
-
case 37: goto st32;
|
578
|
+
case 35: goto tr38;
|
690
579
|
case 60: goto st0;
|
691
580
|
case 62: goto st0;
|
692
|
-
case 63: goto
|
581
|
+
case 63: goto tr39;
|
693
582
|
case 127: goto st0;
|
694
583
|
}
|
695
584
|
if ( 0 <= (*p) && (*p) <= 31 )
|
696
585
|
goto st0;
|
697
|
-
goto
|
698
|
-
|
699
|
-
|
700
|
-
goto _test_eof32;
|
701
|
-
case 32:
|
702
|
-
if ( (*p) < 65 ) {
|
703
|
-
if ( 48 <= (*p) && (*p) <= 57 )
|
704
|
-
goto st33;
|
705
|
-
} else if ( (*p) > 70 ) {
|
706
|
-
if ( 97 <= (*p) && (*p) <= 102 )
|
707
|
-
goto st33;
|
708
|
-
} else
|
709
|
-
goto st33;
|
710
|
-
goto st0;
|
711
|
-
st33:
|
712
|
-
if ( ++p == pe )
|
713
|
-
goto _test_eof33;
|
714
|
-
case 33:
|
715
|
-
if ( (*p) < 65 ) {
|
716
|
-
if ( 48 <= (*p) && (*p) <= 57 )
|
717
|
-
goto st31;
|
718
|
-
} else if ( (*p) > 70 ) {
|
719
|
-
if ( 97 <= (*p) && (*p) <= 102 )
|
720
|
-
goto st31;
|
721
|
-
} else
|
722
|
-
goto st31;
|
723
|
-
goto st0;
|
724
|
-
tr46:
|
725
|
-
#line 66 "ext/http11/http11_parser.rl"
|
586
|
+
goto st24;
|
587
|
+
tr39:
|
588
|
+
#line 67 "ext/puma_http11/http11_parser.rl"
|
726
589
|
{
|
727
590
|
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
728
591
|
}
|
729
|
-
goto
|
730
|
-
|
592
|
+
goto st25;
|
593
|
+
st25:
|
731
594
|
if ( ++p == pe )
|
732
|
-
goto
|
733
|
-
case
|
734
|
-
#line
|
595
|
+
goto _test_eof25;
|
596
|
+
case 25:
|
597
|
+
#line 598 "ext/puma_http11/http11_parser.c"
|
735
598
|
switch( (*p) ) {
|
736
|
-
case 32: goto
|
599
|
+
case 32: goto tr41;
|
737
600
|
case 34: goto st0;
|
738
|
-
case 35: goto
|
739
|
-
case 37: goto tr55;
|
601
|
+
case 35: goto tr42;
|
740
602
|
case 60: goto st0;
|
741
603
|
case 62: goto st0;
|
742
604
|
case 127: goto st0;
|
743
605
|
}
|
744
606
|
if ( 0 <= (*p) && (*p) <= 31 )
|
745
607
|
goto st0;
|
746
|
-
goto
|
747
|
-
|
748
|
-
#line
|
608
|
+
goto tr40;
|
609
|
+
tr40:
|
610
|
+
#line 58 "ext/puma_http11/http11_parser.rl"
|
749
611
|
{ MARK(query_start, p); }
|
750
|
-
goto
|
751
|
-
|
612
|
+
goto st26;
|
613
|
+
st26:
|
752
614
|
if ( ++p == pe )
|
753
|
-
goto
|
754
|
-
case
|
755
|
-
#line
|
615
|
+
goto _test_eof26;
|
616
|
+
case 26:
|
617
|
+
#line 618 "ext/puma_http11/http11_parser.c"
|
756
618
|
switch( (*p) ) {
|
757
|
-
case 32: goto
|
619
|
+
case 32: goto tr44;
|
758
620
|
case 34: goto st0;
|
759
|
-
case 35: goto
|
760
|
-
case 37: goto st36;
|
621
|
+
case 35: goto tr45;
|
761
622
|
case 60: goto st0;
|
762
623
|
case 62: goto st0;
|
763
624
|
case 127: goto st0;
|
764
625
|
}
|
765
626
|
if ( 0 <= (*p) && (*p) <= 31 )
|
766
627
|
goto st0;
|
767
|
-
goto
|
768
|
-
|
769
|
-
#line 57 "ext/http11/http11_parser.rl"
|
770
|
-
{ MARK(query_start, p); }
|
771
|
-
goto st36;
|
772
|
-
st36:
|
773
|
-
if ( ++p == pe )
|
774
|
-
goto _test_eof36;
|
775
|
-
case 36:
|
776
|
-
#line 777 "ext/http11/http11_parser.c"
|
777
|
-
if ( (*p) < 65 ) {
|
778
|
-
if ( 48 <= (*p) && (*p) <= 57 )
|
779
|
-
goto st37;
|
780
|
-
} else if ( (*p) > 70 ) {
|
781
|
-
if ( 97 <= (*p) && (*p) <= 102 )
|
782
|
-
goto st37;
|
783
|
-
} else
|
784
|
-
goto st37;
|
785
|
-
goto st0;
|
786
|
-
st37:
|
787
|
-
if ( ++p == pe )
|
788
|
-
goto _test_eof37;
|
789
|
-
case 37:
|
790
|
-
if ( (*p) < 65 ) {
|
791
|
-
if ( 48 <= (*p) && (*p) <= 57 )
|
792
|
-
goto st35;
|
793
|
-
} else if ( (*p) > 70 ) {
|
794
|
-
if ( 97 <= (*p) && (*p) <= 102 )
|
795
|
-
goto st35;
|
796
|
-
} else
|
797
|
-
goto st35;
|
798
|
-
goto st0;
|
799
|
-
st38:
|
628
|
+
goto st26;
|
629
|
+
st27:
|
800
630
|
if ( ++p == pe )
|
801
|
-
goto
|
802
|
-
case
|
631
|
+
goto _test_eof27;
|
632
|
+
case 27:
|
803
633
|
switch( (*p) ) {
|
804
634
|
case 32: goto tr2;
|
805
|
-
case 36: goto
|
806
|
-
case 95: goto
|
635
|
+
case 36: goto st28;
|
636
|
+
case 95: goto st28;
|
807
637
|
}
|
808
638
|
if ( (*p) < 48 ) {
|
809
639
|
if ( 45 <= (*p) && (*p) <= 46 )
|
810
|
-
goto
|
640
|
+
goto st28;
|
811
641
|
} else if ( (*p) > 57 ) {
|
812
642
|
if ( 65 <= (*p) && (*p) <= 90 )
|
813
|
-
goto
|
643
|
+
goto st28;
|
814
644
|
} else
|
815
|
-
goto
|
645
|
+
goto st28;
|
816
646
|
goto st0;
|
817
|
-
|
647
|
+
st28:
|
818
648
|
if ( ++p == pe )
|
819
|
-
goto
|
820
|
-
case
|
649
|
+
goto _test_eof28;
|
650
|
+
case 28:
|
821
651
|
switch( (*p) ) {
|
822
652
|
case 32: goto tr2;
|
823
|
-
case 36: goto
|
824
|
-
case 95: goto
|
653
|
+
case 36: goto st29;
|
654
|
+
case 95: goto st29;
|
825
655
|
}
|
826
656
|
if ( (*p) < 48 ) {
|
827
657
|
if ( 45 <= (*p) && (*p) <= 46 )
|
828
|
-
goto
|
658
|
+
goto st29;
|
829
659
|
} else if ( (*p) > 57 ) {
|
830
660
|
if ( 65 <= (*p) && (*p) <= 90 )
|
831
|
-
goto
|
661
|
+
goto st29;
|
832
662
|
} else
|
833
|
-
goto
|
663
|
+
goto st29;
|
834
664
|
goto st0;
|
835
|
-
|
665
|
+
st29:
|
836
666
|
if ( ++p == pe )
|
837
|
-
goto
|
838
|
-
case
|
667
|
+
goto _test_eof29;
|
668
|
+
case 29:
|
839
669
|
switch( (*p) ) {
|
840
670
|
case 32: goto tr2;
|
841
|
-
case 36: goto
|
842
|
-
case 95: goto
|
671
|
+
case 36: goto st30;
|
672
|
+
case 95: goto st30;
|
843
673
|
}
|
844
674
|
if ( (*p) < 48 ) {
|
845
675
|
if ( 45 <= (*p) && (*p) <= 46 )
|
846
|
-
goto
|
676
|
+
goto st30;
|
847
677
|
} else if ( (*p) > 57 ) {
|
848
678
|
if ( 65 <= (*p) && (*p) <= 90 )
|
849
|
-
goto
|
679
|
+
goto st30;
|
850
680
|
} else
|
851
|
-
goto
|
681
|
+
goto st30;
|
852
682
|
goto st0;
|
853
|
-
|
683
|
+
st30:
|
854
684
|
if ( ++p == pe )
|
855
|
-
goto
|
856
|
-
case
|
685
|
+
goto _test_eof30;
|
686
|
+
case 30:
|
857
687
|
switch( (*p) ) {
|
858
688
|
case 32: goto tr2;
|
859
|
-
case 36: goto
|
860
|
-
case 95: goto
|
689
|
+
case 36: goto st31;
|
690
|
+
case 95: goto st31;
|
861
691
|
}
|
862
692
|
if ( (*p) < 48 ) {
|
863
693
|
if ( 45 <= (*p) && (*p) <= 46 )
|
864
|
-
goto
|
694
|
+
goto st31;
|
865
695
|
} else if ( (*p) > 57 ) {
|
866
696
|
if ( 65 <= (*p) && (*p) <= 90 )
|
867
|
-
goto
|
697
|
+
goto st31;
|
868
698
|
} else
|
869
|
-
goto
|
699
|
+
goto st31;
|
870
700
|
goto st0;
|
871
|
-
|
701
|
+
st31:
|
872
702
|
if ( ++p == pe )
|
873
|
-
goto
|
874
|
-
case
|
703
|
+
goto _test_eof31;
|
704
|
+
case 31:
|
875
705
|
switch( (*p) ) {
|
876
706
|
case 32: goto tr2;
|
877
|
-
case 36: goto
|
878
|
-
case 95: goto
|
707
|
+
case 36: goto st32;
|
708
|
+
case 95: goto st32;
|
879
709
|
}
|
880
710
|
if ( (*p) < 48 ) {
|
881
711
|
if ( 45 <= (*p) && (*p) <= 46 )
|
882
|
-
goto
|
712
|
+
goto st32;
|
883
713
|
} else if ( (*p) > 57 ) {
|
884
714
|
if ( 65 <= (*p) && (*p) <= 90 )
|
885
|
-
goto
|
715
|
+
goto st32;
|
886
716
|
} else
|
887
|
-
goto
|
717
|
+
goto st32;
|
888
718
|
goto st0;
|
889
|
-
|
719
|
+
st32:
|
890
720
|
if ( ++p == pe )
|
891
|
-
goto
|
892
|
-
case
|
721
|
+
goto _test_eof32;
|
722
|
+
case 32:
|
893
723
|
switch( (*p) ) {
|
894
724
|
case 32: goto tr2;
|
895
|
-
case 36: goto
|
896
|
-
case 95: goto
|
725
|
+
case 36: goto st33;
|
726
|
+
case 95: goto st33;
|
897
727
|
}
|
898
728
|
if ( (*p) < 48 ) {
|
899
729
|
if ( 45 <= (*p) && (*p) <= 46 )
|
900
|
-
goto
|
730
|
+
goto st33;
|
901
731
|
} else if ( (*p) > 57 ) {
|
902
732
|
if ( 65 <= (*p) && (*p) <= 90 )
|
903
|
-
goto
|
733
|
+
goto st33;
|
904
734
|
} else
|
905
|
-
goto
|
735
|
+
goto st33;
|
906
736
|
goto st0;
|
907
|
-
|
737
|
+
st33:
|
908
738
|
if ( ++p == pe )
|
909
|
-
goto
|
910
|
-
case
|
739
|
+
goto _test_eof33;
|
740
|
+
case 33:
|
911
741
|
switch( (*p) ) {
|
912
742
|
case 32: goto tr2;
|
913
|
-
case 36: goto
|
914
|
-
case 95: goto
|
743
|
+
case 36: goto st34;
|
744
|
+
case 95: goto st34;
|
915
745
|
}
|
916
746
|
if ( (*p) < 48 ) {
|
917
747
|
if ( 45 <= (*p) && (*p) <= 46 )
|
918
|
-
goto
|
748
|
+
goto st34;
|
919
749
|
} else if ( (*p) > 57 ) {
|
920
750
|
if ( 65 <= (*p) && (*p) <= 90 )
|
921
|
-
goto
|
751
|
+
goto st34;
|
922
752
|
} else
|
923
|
-
goto
|
753
|
+
goto st34;
|
924
754
|
goto st0;
|
925
|
-
|
755
|
+
st34:
|
926
756
|
if ( ++p == pe )
|
927
|
-
goto
|
928
|
-
case
|
757
|
+
goto _test_eof34;
|
758
|
+
case 34:
|
929
759
|
switch( (*p) ) {
|
930
760
|
case 32: goto tr2;
|
931
|
-
case 36: goto
|
932
|
-
case 95: goto
|
761
|
+
case 36: goto st35;
|
762
|
+
case 95: goto st35;
|
933
763
|
}
|
934
764
|
if ( (*p) < 48 ) {
|
935
765
|
if ( 45 <= (*p) && (*p) <= 46 )
|
936
|
-
goto
|
766
|
+
goto st35;
|
937
767
|
} else if ( (*p) > 57 ) {
|
938
768
|
if ( 65 <= (*p) && (*p) <= 90 )
|
939
|
-
goto
|
769
|
+
goto st35;
|
940
770
|
} else
|
941
|
-
goto
|
771
|
+
goto st35;
|
942
772
|
goto st0;
|
943
|
-
|
773
|
+
st35:
|
944
774
|
if ( ++p == pe )
|
945
|
-
goto
|
946
|
-
case
|
775
|
+
goto _test_eof35;
|
776
|
+
case 35:
|
947
777
|
switch( (*p) ) {
|
948
778
|
case 32: goto tr2;
|
949
|
-
case 36: goto
|
950
|
-
case 95: goto
|
779
|
+
case 36: goto st36;
|
780
|
+
case 95: goto st36;
|
951
781
|
}
|
952
782
|
if ( (*p) < 48 ) {
|
953
783
|
if ( 45 <= (*p) && (*p) <= 46 )
|
954
|
-
goto
|
784
|
+
goto st36;
|
955
785
|
} else if ( (*p) > 57 ) {
|
956
786
|
if ( 65 <= (*p) && (*p) <= 90 )
|
957
|
-
goto
|
787
|
+
goto st36;
|
958
788
|
} else
|
959
|
-
goto
|
789
|
+
goto st36;
|
960
790
|
goto st0;
|
961
|
-
|
791
|
+
st36:
|
962
792
|
if ( ++p == pe )
|
963
|
-
goto
|
964
|
-
case
|
793
|
+
goto _test_eof36;
|
794
|
+
case 36:
|
965
795
|
switch( (*p) ) {
|
966
796
|
case 32: goto tr2;
|
967
|
-
case 36: goto
|
968
|
-
case 95: goto
|
797
|
+
case 36: goto st37;
|
798
|
+
case 95: goto st37;
|
969
799
|
}
|
970
800
|
if ( (*p) < 48 ) {
|
971
801
|
if ( 45 <= (*p) && (*p) <= 46 )
|
972
|
-
goto
|
802
|
+
goto st37;
|
973
803
|
} else if ( (*p) > 57 ) {
|
974
804
|
if ( 65 <= (*p) && (*p) <= 90 )
|
975
|
-
goto
|
805
|
+
goto st37;
|
976
806
|
} else
|
977
|
-
goto
|
807
|
+
goto st37;
|
978
808
|
goto st0;
|
979
|
-
|
809
|
+
st37:
|
980
810
|
if ( ++p == pe )
|
981
|
-
goto
|
982
|
-
case
|
811
|
+
goto _test_eof37;
|
812
|
+
case 37:
|
983
813
|
switch( (*p) ) {
|
984
814
|
case 32: goto tr2;
|
985
|
-
case 36: goto
|
986
|
-
case 95: goto
|
815
|
+
case 36: goto st38;
|
816
|
+
case 95: goto st38;
|
987
817
|
}
|
988
818
|
if ( (*p) < 48 ) {
|
989
819
|
if ( 45 <= (*p) && (*p) <= 46 )
|
990
|
-
goto
|
820
|
+
goto st38;
|
991
821
|
} else if ( (*p) > 57 ) {
|
992
822
|
if ( 65 <= (*p) && (*p) <= 90 )
|
993
|
-
goto
|
823
|
+
goto st38;
|
994
824
|
} else
|
995
|
-
goto
|
825
|
+
goto st38;
|
996
826
|
goto st0;
|
997
|
-
|
827
|
+
st38:
|
998
828
|
if ( ++p == pe )
|
999
|
-
goto
|
1000
|
-
case
|
829
|
+
goto _test_eof38;
|
830
|
+
case 38:
|
1001
831
|
switch( (*p) ) {
|
1002
832
|
case 32: goto tr2;
|
1003
|
-
case 36: goto
|
1004
|
-
case 95: goto
|
833
|
+
case 36: goto st39;
|
834
|
+
case 95: goto st39;
|
1005
835
|
}
|
1006
836
|
if ( (*p) < 48 ) {
|
1007
837
|
if ( 45 <= (*p) && (*p) <= 46 )
|
1008
|
-
goto
|
838
|
+
goto st39;
|
1009
839
|
} else if ( (*p) > 57 ) {
|
1010
840
|
if ( 65 <= (*p) && (*p) <= 90 )
|
1011
|
-
goto
|
841
|
+
goto st39;
|
1012
842
|
} else
|
1013
|
-
goto
|
843
|
+
goto st39;
|
1014
844
|
goto st0;
|
1015
|
-
|
845
|
+
st39:
|
1016
846
|
if ( ++p == pe )
|
1017
|
-
goto
|
1018
|
-
case
|
847
|
+
goto _test_eof39;
|
848
|
+
case 39:
|
1019
849
|
switch( (*p) ) {
|
1020
850
|
case 32: goto tr2;
|
1021
|
-
case 36: goto
|
1022
|
-
case 95: goto
|
851
|
+
case 36: goto st40;
|
852
|
+
case 95: goto st40;
|
1023
853
|
}
|
1024
854
|
if ( (*p) < 48 ) {
|
1025
855
|
if ( 45 <= (*p) && (*p) <= 46 )
|
1026
|
-
goto
|
856
|
+
goto st40;
|
1027
857
|
} else if ( (*p) > 57 ) {
|
1028
858
|
if ( 65 <= (*p) && (*p) <= 90 )
|
1029
|
-
goto
|
859
|
+
goto st40;
|
1030
860
|
} else
|
1031
|
-
goto
|
861
|
+
goto st40;
|
1032
862
|
goto st0;
|
1033
|
-
|
863
|
+
st40:
|
1034
864
|
if ( ++p == pe )
|
1035
|
-
goto
|
1036
|
-
case
|
865
|
+
goto _test_eof40;
|
866
|
+
case 40:
|
1037
867
|
switch( (*p) ) {
|
1038
868
|
case 32: goto tr2;
|
1039
|
-
case 36: goto
|
1040
|
-
case 95: goto
|
869
|
+
case 36: goto st41;
|
870
|
+
case 95: goto st41;
|
1041
871
|
}
|
1042
872
|
if ( (*p) < 48 ) {
|
1043
873
|
if ( 45 <= (*p) && (*p) <= 46 )
|
1044
|
-
goto
|
874
|
+
goto st41;
|
1045
875
|
} else if ( (*p) > 57 ) {
|
1046
876
|
if ( 65 <= (*p) && (*p) <= 90 )
|
1047
|
-
goto
|
877
|
+
goto st41;
|
1048
878
|
} else
|
1049
|
-
goto
|
879
|
+
goto st41;
|
1050
880
|
goto st0;
|
1051
|
-
|
881
|
+
st41:
|
1052
882
|
if ( ++p == pe )
|
1053
|
-
goto
|
1054
|
-
case
|
883
|
+
goto _test_eof41;
|
884
|
+
case 41:
|
1055
885
|
switch( (*p) ) {
|
1056
886
|
case 32: goto tr2;
|
1057
|
-
case 36: goto
|
1058
|
-
case 95: goto
|
887
|
+
case 36: goto st42;
|
888
|
+
case 95: goto st42;
|
1059
889
|
}
|
1060
890
|
if ( (*p) < 48 ) {
|
1061
891
|
if ( 45 <= (*p) && (*p) <= 46 )
|
1062
|
-
goto
|
892
|
+
goto st42;
|
1063
893
|
} else if ( (*p) > 57 ) {
|
1064
894
|
if ( 65 <= (*p) && (*p) <= 90 )
|
1065
|
-
goto
|
895
|
+
goto st42;
|
1066
896
|
} else
|
1067
|
-
goto
|
897
|
+
goto st42;
|
1068
898
|
goto st0;
|
1069
|
-
|
899
|
+
st42:
|
1070
900
|
if ( ++p == pe )
|
1071
|
-
goto
|
1072
|
-
case
|
901
|
+
goto _test_eof42;
|
902
|
+
case 42:
|
1073
903
|
switch( (*p) ) {
|
1074
904
|
case 32: goto tr2;
|
1075
|
-
case 36: goto
|
1076
|
-
case 95: goto
|
905
|
+
case 36: goto st43;
|
906
|
+
case 95: goto st43;
|
1077
907
|
}
|
1078
908
|
if ( (*p) < 48 ) {
|
1079
909
|
if ( 45 <= (*p) && (*p) <= 46 )
|
1080
|
-
goto
|
910
|
+
goto st43;
|
1081
911
|
} else if ( (*p) > 57 ) {
|
1082
912
|
if ( 65 <= (*p) && (*p) <= 90 )
|
1083
|
-
goto
|
913
|
+
goto st43;
|
1084
914
|
} else
|
1085
|
-
goto
|
915
|
+
goto st43;
|
1086
916
|
goto st0;
|
1087
|
-
|
917
|
+
st43:
|
1088
918
|
if ( ++p == pe )
|
1089
|
-
goto
|
1090
|
-
case
|
919
|
+
goto _test_eof43;
|
920
|
+
case 43:
|
1091
921
|
switch( (*p) ) {
|
1092
922
|
case 32: goto tr2;
|
1093
|
-
case 36: goto
|
1094
|
-
case 95: goto
|
923
|
+
case 36: goto st44;
|
924
|
+
case 95: goto st44;
|
1095
925
|
}
|
1096
926
|
if ( (*p) < 48 ) {
|
1097
927
|
if ( 45 <= (*p) && (*p) <= 46 )
|
1098
|
-
goto
|
928
|
+
goto st44;
|
1099
929
|
} else if ( (*p) > 57 ) {
|
1100
930
|
if ( 65 <= (*p) && (*p) <= 90 )
|
1101
|
-
goto
|
931
|
+
goto st44;
|
1102
932
|
} else
|
1103
|
-
goto
|
933
|
+
goto st44;
|
1104
934
|
goto st0;
|
1105
|
-
|
935
|
+
st44:
|
1106
936
|
if ( ++p == pe )
|
1107
|
-
goto
|
1108
|
-
case
|
937
|
+
goto _test_eof44;
|
938
|
+
case 44:
|
1109
939
|
switch( (*p) ) {
|
1110
940
|
case 32: goto tr2;
|
1111
|
-
case 36: goto
|
1112
|
-
case 95: goto
|
941
|
+
case 36: goto st45;
|
942
|
+
case 95: goto st45;
|
1113
943
|
}
|
1114
944
|
if ( (*p) < 48 ) {
|
1115
945
|
if ( 45 <= (*p) && (*p) <= 46 )
|
1116
|
-
goto
|
946
|
+
goto st45;
|
1117
947
|
} else if ( (*p) > 57 ) {
|
1118
948
|
if ( 65 <= (*p) && (*p) <= 90 )
|
1119
|
-
goto
|
949
|
+
goto st45;
|
1120
950
|
} else
|
1121
|
-
goto
|
951
|
+
goto st45;
|
1122
952
|
goto st0;
|
1123
|
-
|
953
|
+
st45:
|
1124
954
|
if ( ++p == pe )
|
1125
|
-
goto
|
1126
|
-
case
|
955
|
+
goto _test_eof45;
|
956
|
+
case 45:
|
1127
957
|
if ( (*p) == 32 )
|
1128
958
|
goto tr2;
|
1129
959
|
goto st0;
|
@@ -1143,7 +973,7 @@ case 56:
|
|
1143
973
|
_test_eof14: cs = 14; goto _test_eof;
|
1144
974
|
_test_eof15: cs = 15; goto _test_eof;
|
1145
975
|
_test_eof16: cs = 16; goto _test_eof;
|
1146
|
-
|
976
|
+
_test_eof46: cs = 46; goto _test_eof;
|
1147
977
|
_test_eof17: cs = 17; goto _test_eof;
|
1148
978
|
_test_eof18: cs = 18; goto _test_eof;
|
1149
979
|
_test_eof19: cs = 19; goto _test_eof;
|
@@ -1173,23 +1003,12 @@ case 56:
|
|
1173
1003
|
_test_eof43: cs = 43; goto _test_eof;
|
1174
1004
|
_test_eof44: cs = 44; goto _test_eof;
|
1175
1005
|
_test_eof45: cs = 45; goto _test_eof;
|
1176
|
-
_test_eof46: cs = 46; goto _test_eof;
|
1177
|
-
_test_eof47: cs = 47; goto _test_eof;
|
1178
|
-
_test_eof48: cs = 48; goto _test_eof;
|
1179
|
-
_test_eof49: cs = 49; goto _test_eof;
|
1180
|
-
_test_eof50: cs = 50; goto _test_eof;
|
1181
|
-
_test_eof51: cs = 51; goto _test_eof;
|
1182
|
-
_test_eof52: cs = 52; goto _test_eof;
|
1183
|
-
_test_eof53: cs = 53; goto _test_eof;
|
1184
|
-
_test_eof54: cs = 54; goto _test_eof;
|
1185
|
-
_test_eof55: cs = 55; goto _test_eof;
|
1186
|
-
_test_eof56: cs = 56; goto _test_eof;
|
1187
1006
|
|
1188
1007
|
_test_eof: {}
|
1189
1008
|
_out: {}
|
1190
1009
|
}
|
1191
1010
|
|
1192
|
-
#line
|
1011
|
+
#line 115 "ext/puma_http11/http11_parser.rl"
|
1193
1012
|
|
1194
1013
|
if (!puma_parser_has_error(parser))
|
1195
1014
|
parser->cs = cs;
|