puma 4.1.1 → 5.0.0
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 +4 -4
- data/History.md +149 -10
- data/LICENSE +23 -20
- data/README.md +30 -46
- data/docs/architecture.md +3 -3
- data/docs/deployment.md +9 -3
- data/docs/fork_worker.md +31 -0
- data/docs/jungle/README.md +13 -0
- data/{tools → docs}/jungle/rc.d/README.md +0 -0
- data/{tools → docs}/jungle/rc.d/puma +0 -0
- data/{tools → docs}/jungle/rc.d/puma.conf +0 -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 +0 -0
- data/docs/plugins.md +20 -10
- data/docs/signals.md +7 -6
- data/docs/systemd.md +1 -63
- data/ext/puma_http11/PumaHttp11Service.java +2 -4
- data/ext/puma_http11/extconf.rb +6 -0
- data/ext/puma_http11/http11_parser.c +40 -63
- data/ext/puma_http11/http11_parser.java.rl +21 -37
- data/ext/puma_http11/http11_parser.rl +3 -1
- data/ext/puma_http11/http11_parser_common.rl +3 -3
- data/ext/puma_http11/mini_ssl.c +15 -2
- data/ext/puma_http11/no_ssl/PumaHttp11Service.java +15 -0
- data/ext/puma_http11/org/jruby/puma/Http11.java +108 -116
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +91 -106
- data/ext/puma_http11/org/jruby/puma/MiniSSL.java +77 -18
- data/ext/puma_http11/puma_http11.c +9 -38
- data/lib/puma.rb +23 -0
- data/lib/puma/app/status.rb +46 -30
- data/lib/puma/binder.rb +112 -124
- data/lib/puma/cli.rb +11 -15
- data/lib/puma/client.rb +250 -209
- data/lib/puma/cluster.rb +203 -85
- data/lib/puma/commonlogger.rb +2 -2
- data/lib/puma/configuration.rb +31 -42
- data/lib/puma/const.rb +24 -19
- data/lib/puma/control_cli.rb +46 -17
- data/lib/puma/detect.rb +17 -0
- data/lib/puma/dsl.rb +162 -70
- data/lib/puma/error_logger.rb +97 -0
- data/lib/puma/events.rb +35 -31
- data/lib/puma/io_buffer.rb +9 -2
- data/lib/puma/jruby_restart.rb +0 -58
- data/lib/puma/launcher.rb +117 -58
- data/lib/puma/minissl.rb +60 -18
- data/lib/puma/minissl/context_builder.rb +73 -0
- data/lib/puma/null_io.rb +1 -1
- data/lib/puma/plugin.rb +6 -12
- data/lib/puma/rack/builder.rb +0 -4
- data/lib/puma/reactor.rb +16 -9
- data/lib/puma/runner.rb +11 -32
- data/lib/puma/server.rb +173 -193
- data/lib/puma/single.rb +7 -64
- data/lib/puma/state_file.rb +6 -3
- data/lib/puma/thread_pool.rb +104 -81
- data/lib/rack/handler/puma.rb +1 -5
- data/tools/Dockerfile +16 -0
- data/tools/trickletest.rb +0 -1
- metadata +23 -24
- data/ext/puma_http11/io_buffer.c +0 -155
- data/ext/puma_http11/org/jruby/puma/IOBuffer.java +0 -72
- data/lib/puma/convenient.rb +0 -25
- data/lib/puma/daemon_ext.rb +0 -33
- data/lib/puma/delegation.rb +0 -13
- data/lib/puma/tcp_logger.rb +0 -41
- data/tools/jungle/README.md +0 -19
- data/tools/jungle/init.d/README.md +0 -61
- data/tools/jungle/init.d/puma +0 -421
- data/tools/jungle/init.d/run-puma +0 -18
data/docs/fork_worker.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Fork-Worker Cluster Mode [Experimental]
|
2
|
+
|
3
|
+
Puma 5 introduces an experimental new cluster-mode configuration option, `fork_worker` (`--fork-worker` from the CLI). This mode causes Puma to fork additional workers from worker 0, instead of directly from the master process:
|
4
|
+
|
5
|
+
```
|
6
|
+
10000 \_ puma 4.3.3 (tcp://0.0.0.0:9292) [puma]
|
7
|
+
10001 \_ puma: cluster worker 0: 10000 [puma]
|
8
|
+
10002 \_ puma: cluster worker 1: 10000 [puma]
|
9
|
+
10003 \_ puma: cluster worker 2: 10000 [puma]
|
10
|
+
10004 \_ puma: cluster worker 3: 10000 [puma]
|
11
|
+
```
|
12
|
+
|
13
|
+
Similar to the `preload_app!` option, the `fork_worker` option allows your application to be initialized only once for copy-on-write memory savings, and it has two additional advantages:
|
14
|
+
|
15
|
+
1. **Compatible with phased restart.** Because the master process itself doesn't preload the application, this mode works with phased restart (`SIGUSR1` or `pumactl phased-restart`). When worker 0 reloads as part of a phased restart, it initializes a new copy of your application first, then the other workers reload by forking from this new worker already containing the new preloaded application.
|
16
|
+
|
17
|
+
This allows a phased restart to complete as quickly as a hot restart (`SIGUSR2` or `pumactl restart`), while still minimizing downtime by staggering the restart across cluster workers.
|
18
|
+
|
19
|
+
2. **'Refork' for additional copy-on-write improvements in running applications.** Fork-worker mode introduces a new `refork` command that re-loads all nonzero workers by re-forking them from worker 0.
|
20
|
+
|
21
|
+
This command can potentially improve memory utilization in large or complex applications that don't fully pre-initialize on startup, because the re-forked workers can share copy-on-write memory with a worker that has been running for a while and serving requests.
|
22
|
+
|
23
|
+
You can trigger a refork by sending the cluster the `SIGURG` signal or running the `pumactl refork` command at any time. A refork will also automatically trigger once, after a certain number of requests have been processed by worker 0 (default 1000). To configure the number of requests before the auto-refork, pass a positive integer argument to `fork_worker` (e.g., `fork_worker 1000`), or `0` to disable.
|
24
|
+
|
25
|
+
### Limitations
|
26
|
+
|
27
|
+
- This mode is still very experimental so there may be bugs or edge-cases, particularly around expected behavior of existing hooks. Please open a [bug report](https://github.com/puma/puma/issues/new?template=bug_report.md) if you encounter any issues.
|
28
|
+
|
29
|
+
- In order to fork new workers cleanly, worker 0 shuts down its server and stops serving requests so there are no open file descriptors or other kinds of shared global state between processes, and to maximize copy-on-write efficiency across the newly-forked workers. This may temporarily reduce total capacity of the cluster during a phased restart / refork.
|
30
|
+
|
31
|
+
In a cluster with `n` workers, a normal phased restart stops and restarts workers one by one while the application is loaded in each process, so `n-1` workers are available serving requests during the restart. In a phased restart in fork-worker mode, the application is first loaded in worker 0 while `n-1` workers are available, then worker 0 remains stopped while the rest of the workers are reloaded one by one, leaving only `n-2` workers to be available for a brief period of time. Reloading the rest of the workers should be quick because the application is preloaded at that point, but there may be situations where it can take longer (slow clients, long-running application code, slow worker-fork hooks, etc).
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Puma as a service
|
2
|
+
|
3
|
+
## Upstart
|
4
|
+
|
5
|
+
See `/docs/jungle/upstart` for Ubuntu's upstart scripts.
|
6
|
+
|
7
|
+
## Systemd
|
8
|
+
|
9
|
+
See [/docs/systemd](https://github.com/puma/puma/blob/master/docs/systemd.md).
|
10
|
+
|
11
|
+
## rc.d
|
12
|
+
|
13
|
+
See `/docs/jungle/rc.d` for FreeBSD's rc.d scripts
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/docs/plugins.md
CHANGED
@@ -1,15 +1,22 @@
|
|
1
1
|
## Plugins
|
2
2
|
|
3
|
-
Puma 3.0 added support for plugins that can augment configuration and service
|
3
|
+
Puma 3.0 added support for plugins that can augment configuration and service
|
4
|
+
operations.
|
4
5
|
|
5
6
|
2 canonical plugins to look to aid in development of further plugins:
|
6
7
|
|
7
|
-
* [tmp\_restart](https://github.com/puma/puma/blob/master/lib/puma/plugin/tmp_restart.rb):
|
8
|
-
|
8
|
+
* [tmp\_restart](https://github.com/puma/puma/blob/master/lib/puma/plugin/tmp_restart.rb):
|
9
|
+
Restarts the server if the file `tmp/restart.txt` is touched
|
10
|
+
* [heroku](https://github.com/puma/puma-heroku/blob/master/lib/puma/plugin/heroku.rb):
|
11
|
+
Packages up the default configuration used by puma on Heroku
|
9
12
|
|
10
|
-
Plugins are activated in a puma configuration file (such as `config/puma.rb'`)
|
13
|
+
Plugins are activated in a puma configuration file (such as `config/puma.rb'`)
|
14
|
+
by adding `plugin "name"`, such as `plugin "heroku"`.
|
11
15
|
|
12
|
-
Plugins are activated based simply on path requirements so, activating the
|
16
|
+
Plugins are activated based simply on path requirements so, activating the
|
17
|
+
`heroku` plugin will simply be doing `require "puma/plugin/heroku"`. This
|
18
|
+
allows gems to provide multiple plugins (as well as unrelated gems to provide
|
19
|
+
puma plugins).
|
13
20
|
|
14
21
|
The `tmp_restart` plugin is bundled with puma, so it can always be used.
|
15
22
|
|
@@ -17,12 +24,15 @@ To use the `heroku` plugin, add `puma-heroku` to your Gemfile or install it.
|
|
17
24
|
|
18
25
|
### API
|
19
26
|
|
20
|
-
|
27
|
+
## Server-wide hooks
|
21
28
|
|
22
|
-
|
29
|
+
Plugins can use a couple of hooks at server level: `start` and `config`.
|
23
30
|
|
24
|
-
`
|
31
|
+
`start` runs when the server has started and allows the plugin to start other
|
32
|
+
functionality to augment puma.
|
25
33
|
|
26
|
-
|
34
|
+
`config` runs when the server is being configured and is passed a `Puma::DSL`
|
35
|
+
object that can be used to add additional configuration.
|
27
36
|
|
28
|
-
|
37
|
+
Any public methods in `Puma::Plugin` are the public API that any plugin may
|
38
|
+
use.
|
data/docs/signals.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
The [unix signal](
|
1
|
+
The [unix signal](https://en.wikipedia.org/wiki/Unix_signal) is a method of sending messages between [processes](https://en.wikipedia.org/wiki/Process_(computing)). When a signal is sent, the operating system interrupts the target process's normal flow of execution. There are standard signals that are used to stop a process but there are also custom signals that can be used for other purposes. This document is an attempt to list all supported signals that Puma will respond to. In general, signals need only be sent to the master process of a cluster.
|
2
2
|
|
3
3
|
## Sending Signals
|
4
4
|
|
5
|
-
If you are new to signals it can be useful to see how they can be used. When a process is created in a *nix like operating system it will have a [PID - or process identifier](
|
5
|
+
If you are new to signals it can be useful to see how they can be used. When a process is created in a *nix like operating system it will have a [PID - or process identifier](https://en.wikipedia.org/wiki/Process_identifier) that can be used to send signals to the process. For demonstration we will create an infinitely running process by tailing a file:
|
6
6
|
|
7
7
|
```sh
|
8
8
|
$ echo "foo" >> my.log
|
@@ -17,13 +17,13 @@ $ ps aux | grep tail
|
|
17
17
|
schneems 87152 0.0 0.0 2432772 492 s032 S+ 12:46PM 0:00.00 tail -f my.log
|
18
18
|
```
|
19
19
|
|
20
|
-
You can send a signal in Ruby using the [Process module](
|
20
|
+
You can send a signal in Ruby using the [Process module](https://www.ruby-doc.org/core-2.1.1/Process.html#kill-method):
|
21
21
|
|
22
22
|
```
|
23
23
|
$ irb
|
24
24
|
> puts pid
|
25
25
|
=> 87152
|
26
|
-
Process.detach(pid) #
|
26
|
+
Process.detach(pid) # https://ruby-doc.org/core-2.1.1/Process.html#method-c-detach
|
27
27
|
Process.kill("TERM", pid)
|
28
28
|
```
|
29
29
|
|
@@ -38,9 +38,10 @@ Puma cluster responds to these signals:
|
|
38
38
|
- `TERM` send `TERM` to worker. Worker will attempt to finish then exit.
|
39
39
|
- `USR2` restart workers. This also reloads puma configuration file, if there is one.
|
40
40
|
- `USR1` restart workers in phases, a rolling restart. This will not reload configuration file.
|
41
|
-
- `HUP`
|
42
|
-
- `INT` equivalent of sending Ctrl-C to cluster. Will attempt to finish then exit.
|
41
|
+
- `HUP ` reopen log files defined in stdout_redirect configuration parameter. If there is no stdout_redirect option provided it will behave like `INT`
|
42
|
+
- `INT ` equivalent of sending Ctrl-C to cluster. Will attempt to finish then exit.
|
43
43
|
- `CHLD`
|
44
|
+
- `URG ` refork workers in phases from worker 0, if `fork_workers` option is enabled.
|
44
45
|
|
45
46
|
## Callbacks order in case of different signals
|
46
47
|
|
data/docs/systemd.md
CHANGED
@@ -13,9 +13,7 @@ desired, using an application or instance specific name.
|
|
13
13
|
|
14
14
|
Note that this uses the systemd preferred "simple" type where the
|
15
15
|
start command remains running in the foreground (does not fork and
|
16
|
-
exit).
|
17
|
-
[Alternative Forking Configuration](#alternative-forking-configuration)
|
18
|
-
below.
|
16
|
+
exit).
|
19
17
|
|
20
18
|
~~~~ ini
|
21
19
|
[Unit]
|
@@ -209,66 +207,6 @@ Apr 07 08:40:19 hx puma[28320]: * Activated ssl://0.0.0.0:9234?key=key.pem&cert=
|
|
209
207
|
Apr 07 08:40:19 hx puma[28320]: Use Ctrl-C to stop
|
210
208
|
~~~~
|
211
209
|
|
212
|
-
## Alternative Forking Configuration
|
213
|
-
|
214
|
-
Other systems/tools might expect or need puma to be run as a
|
215
|
-
"traditional" forking server, for example so that the `pumactl`
|
216
|
-
command can be used directly and outside of systemd for
|
217
|
-
stop/start/restart. This use case is incompatible with systemd socket
|
218
|
-
activation, so it should not be configured. Below is an alternative
|
219
|
-
puma.service config sample, using `Type=forking` and the `--daemon`
|
220
|
-
flag in `ExecStart`. Here systemd is playing a role more equivalent to
|
221
|
-
SysV init.d, where it is responsible for starting Puma on boot
|
222
|
-
(multi-user.target) and stopping it on shutdown, but is not performing
|
223
|
-
continuous restarts. Therefore running Puma in cluster mode, where the
|
224
|
-
master can restart workers, is highly recommended. See the systemd
|
225
|
-
[Restart] directive for details.
|
226
|
-
|
227
|
-
~~~~ ini
|
228
|
-
[Unit]
|
229
|
-
Description=Puma HTTP Forking Server
|
230
|
-
After=network.target
|
231
|
-
|
232
|
-
[Service]
|
233
|
-
# Background process configuration (use with --daemon in ExecStart)
|
234
|
-
Type=forking
|
235
|
-
|
236
|
-
# Preferably configure a non-privileged user
|
237
|
-
# User=
|
238
|
-
|
239
|
-
# The path to the puma application root
|
240
|
-
# Also replace the "<WD>" place holders below with this path.
|
241
|
-
WorkingDirectory=
|
242
|
-
|
243
|
-
# The command to start Puma
|
244
|
-
# (replace "<WD>" below)
|
245
|
-
ExecStart=bundle exec puma -C <WD>/shared/puma.rb --daemon
|
246
|
-
|
247
|
-
# The command to stop Puma
|
248
|
-
# (replace "<WD>" below)
|
249
|
-
ExecStop=bundle exec pumactl -S <WD>/shared/tmp/pids/puma.state stop
|
250
|
-
|
251
|
-
# Path to PID file so that systemd knows which is the master process
|
252
|
-
PIDFile=<WD>/shared/tmp/pids/puma.pid
|
253
|
-
|
254
|
-
# Should systemd restart puma?
|
255
|
-
# Use "no" (the default) to ensure no interference when using
|
256
|
-
# stop/start/restart via `pumactl`. The "on-failure" setting might
|
257
|
-
# work better for this purpose, but you must test it.
|
258
|
-
# Use "always" if only `systemctl` is used for start/stop/restart, and
|
259
|
-
# reconsider if you actually need the forking config.
|
260
|
-
Restart=no
|
261
|
-
|
262
|
-
# `puma_ctl restart` wouldn't work without this. It's because `pumactl`
|
263
|
-
# changes PID on restart and systemd stops the service afterwards
|
264
|
-
# because of the PID change. This option prevents stopping after PID
|
265
|
-
# change.
|
266
|
-
RemainAfterExit=yes
|
267
|
-
|
268
|
-
[Install]
|
269
|
-
WantedBy=multi-user.target
|
270
|
-
~~~~
|
271
|
-
|
272
210
|
### capistrano3-puma
|
273
211
|
|
274
212
|
By default,
|
@@ -1,18 +1,16 @@
|
|
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
|
-
import org.jruby.puma.IOBuffer;
|
10
9
|
import org.jruby.puma.MiniSSL;
|
11
10
|
|
12
|
-
public class PumaHttp11Service implements BasicLibraryService {
|
11
|
+
public class PumaHttp11Service implements BasicLibraryService {
|
13
12
|
public boolean basicLoad(final Ruby runtime) throws IOException {
|
14
13
|
Http11.createHttp11(runtime);
|
15
|
-
IOBuffer.createIOBuffer(runtime);
|
16
14
|
MiniSSL.createMiniSSL(runtime);
|
17
15
|
return true;
|
18
16
|
}
|
data/ext/puma_http11/extconf.rb
CHANGED
@@ -2,6 +2,12 @@ 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"]
|
6
12
|
dir_config("openssl")
|
7
13
|
|
@@ -14,12 +14,14 @@
|
|
14
14
|
|
15
15
|
/*
|
16
16
|
* capitalizes all lower-case ASCII characters,
|
17
|
-
* converts dashes to underscores.
|
17
|
+
* converts dashes to underscores, and underscores to commas.
|
18
18
|
*/
|
19
19
|
static void snake_upcase_char(char *c)
|
20
20
|
{
|
21
21
|
if (*c >= 'a' && *c <= 'z')
|
22
22
|
*c &= ~0x20;
|
23
|
+
else if (*c == '_')
|
24
|
+
*c = ',';
|
23
25
|
else if (*c == '-')
|
24
26
|
*c = '_';
|
25
27
|
}
|
@@ -38,7 +40,7 @@ static void snake_upcase_char(char *c)
|
|
38
40
|
|
39
41
|
#line 40 "ext/puma_http11/http11_parser.c"
|
40
42
|
static const int puma_parser_start = 1;
|
41
|
-
static const int puma_parser_first_final =
|
43
|
+
static const int puma_parser_first_final = 46;
|
42
44
|
static const int puma_parser_error = 0;
|
43
45
|
|
44
46
|
static const int puma_parser_en_main = 1;
|
@@ -117,17 +119,17 @@ case 2:
|
|
117
119
|
#line 118 "ext/puma_http11/http11_parser.c"
|
118
120
|
switch( (*p) ) {
|
119
121
|
case 32: goto tr2;
|
120
|
-
case 36: goto
|
121
|
-
case 95: goto
|
122
|
+
case 36: goto st27;
|
123
|
+
case 95: goto st27;
|
122
124
|
}
|
123
125
|
if ( (*p) < 48 ) {
|
124
126
|
if ( 45 <= (*p) && (*p) <= 46 )
|
125
|
-
goto
|
127
|
+
goto st27;
|
126
128
|
} else if ( (*p) > 57 ) {
|
127
129
|
if ( 65 <= (*p) && (*p) <= 90 )
|
128
|
-
goto
|
130
|
+
goto st27;
|
129
131
|
} else
|
130
|
-
goto
|
132
|
+
goto st27;
|
131
133
|
goto st0;
|
132
134
|
tr2:
|
133
135
|
#line 48 "ext/puma_http11/http11_parser.rl"
|
@@ -199,7 +201,7 @@ tr37:
|
|
199
201
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
200
202
|
}
|
201
203
|
goto st5;
|
202
|
-
|
204
|
+
tr41:
|
203
205
|
#line 58 "ext/puma_http11/http11_parser.rl"
|
204
206
|
{ MARK(query_start, p); }
|
205
207
|
#line 59 "ext/puma_http11/http11_parser.rl"
|
@@ -211,7 +213,7 @@ tr44:
|
|
211
213
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
212
214
|
}
|
213
215
|
goto st5;
|
214
|
-
|
216
|
+
tr44:
|
215
217
|
#line 59 "ext/puma_http11/http11_parser.rl"
|
216
218
|
{
|
217
219
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
@@ -362,13 +364,13 @@ tr22:
|
|
362
364
|
{
|
363
365
|
parser->body_start = p - buffer + 1;
|
364
366
|
parser->header_done(parser, p + 1, pe - p - 1);
|
365
|
-
{p++; cs =
|
367
|
+
{p++; cs = 46; goto _out;}
|
366
368
|
}
|
367
|
-
goto
|
368
|
-
|
369
|
+
goto st46;
|
370
|
+
st46:
|
369
371
|
if ( ++p == pe )
|
370
|
-
goto
|
371
|
-
case
|
372
|
+
goto _test_eof46;
|
373
|
+
case 46:
|
372
374
|
#line 373 "ext/puma_http11/http11_parser.c"
|
373
375
|
goto st0;
|
374
376
|
tr21:
|
@@ -458,7 +460,7 @@ tr38:
|
|
458
460
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
459
461
|
}
|
460
462
|
goto st20;
|
461
|
-
|
463
|
+
tr42:
|
462
464
|
#line 58 "ext/puma_http11/http11_parser.rl"
|
463
465
|
{ MARK(query_start, p); }
|
464
466
|
#line 59 "ext/puma_http11/http11_parser.rl"
|
@@ -470,7 +472,7 @@ tr45:
|
|
470
472
|
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
|
471
473
|
}
|
472
474
|
goto st20;
|
473
|
-
|
475
|
+
tr45:
|
474
476
|
#line 59 "ext/puma_http11/http11_parser.rl"
|
475
477
|
{
|
476
478
|
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
|
@@ -576,10 +578,9 @@ case 24:
|
|
576
578
|
case 32: goto tr37;
|
577
579
|
case 34: goto st0;
|
578
580
|
case 35: goto tr38;
|
579
|
-
case 59: goto tr39;
|
580
581
|
case 60: goto st0;
|
581
582
|
case 62: goto st0;
|
582
|
-
case 63: goto
|
583
|
+
case 63: goto tr39;
|
583
584
|
case 127: goto st0;
|
584
585
|
}
|
585
586
|
if ( 0 <= (*p) && (*p) <= 31 )
|
@@ -595,30 +596,27 @@ st25:
|
|
595
596
|
if ( ++p == pe )
|
596
597
|
goto _test_eof25;
|
597
598
|
case 25:
|
598
|
-
#line
|
599
|
+
#line 598 "ext/puma_http11/http11_parser.c"
|
599
600
|
switch( (*p) ) {
|
600
|
-
case 32: goto
|
601
|
+
case 32: goto tr41;
|
601
602
|
case 34: goto st0;
|
602
|
-
case 35: goto
|
603
|
+
case 35: goto tr42;
|
603
604
|
case 60: goto st0;
|
604
605
|
case 62: goto st0;
|
605
|
-
case 63: goto st26;
|
606
606
|
case 127: goto st0;
|
607
607
|
}
|
608
608
|
if ( 0 <= (*p) && (*p) <= 31 )
|
609
609
|
goto st0;
|
610
|
-
goto
|
610
|
+
goto tr40;
|
611
611
|
tr40:
|
612
|
-
#line
|
613
|
-
{
|
614
|
-
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
|
615
|
-
}
|
612
|
+
#line 58 "ext/puma_http11/http11_parser.rl"
|
613
|
+
{ MARK(query_start, p); }
|
616
614
|
goto st26;
|
617
615
|
st26:
|
618
616
|
if ( ++p == pe )
|
619
617
|
goto _test_eof26;
|
620
618
|
case 26:
|
621
|
-
#line
|
619
|
+
#line 618 "ext/puma_http11/http11_parser.c"
|
622
620
|
switch( (*p) ) {
|
623
621
|
case 32: goto tr44;
|
624
622
|
case 34: goto st0;
|
@@ -629,27 +627,25 @@ case 26:
|
|
629
627
|
}
|
630
628
|
if ( 0 <= (*p) && (*p) <= 31 )
|
631
629
|
goto st0;
|
632
|
-
goto
|
633
|
-
tr43:
|
634
|
-
#line 58 "ext/puma_http11/http11_parser.rl"
|
635
|
-
{ MARK(query_start, p); }
|
636
|
-
goto st27;
|
630
|
+
goto st26;
|
637
631
|
st27:
|
638
632
|
if ( ++p == pe )
|
639
633
|
goto _test_eof27;
|
640
634
|
case 27:
|
641
|
-
#line 642 "ext/puma_http11/http11_parser.c"
|
642
635
|
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;
|
636
|
+
case 32: goto tr2;
|
637
|
+
case 36: goto st28;
|
638
|
+
case 95: goto st28;
|
649
639
|
}
|
650
|
-
if (
|
651
|
-
|
652
|
-
|
640
|
+
if ( (*p) < 48 ) {
|
641
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
642
|
+
goto st28;
|
643
|
+
} else if ( (*p) > 57 ) {
|
644
|
+
if ( 65 <= (*p) && (*p) <= 90 )
|
645
|
+
goto st28;
|
646
|
+
} else
|
647
|
+
goto st28;
|
648
|
+
goto st0;
|
653
649
|
st28:
|
654
650
|
if ( ++p == pe )
|
655
651
|
goto _test_eof28;
|
@@ -960,24 +956,6 @@ st45:
|
|
960
956
|
if ( ++p == pe )
|
961
957
|
goto _test_eof45;
|
962
958
|
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
959
|
if ( (*p) == 32 )
|
982
960
|
goto tr2;
|
983
961
|
goto st0;
|
@@ -997,7 +975,7 @@ case 46:
|
|
997
975
|
_test_eof14: cs = 14; goto _test_eof;
|
998
976
|
_test_eof15: cs = 15; goto _test_eof;
|
999
977
|
_test_eof16: cs = 16; goto _test_eof;
|
1000
|
-
|
978
|
+
_test_eof46: cs = 46; goto _test_eof;
|
1001
979
|
_test_eof17: cs = 17; goto _test_eof;
|
1002
980
|
_test_eof18: cs = 18; goto _test_eof;
|
1003
981
|
_test_eof19: cs = 19; goto _test_eof;
|
@@ -1027,7 +1005,6 @@ case 46:
|
|
1027
1005
|
_test_eof43: cs = 43; goto _test_eof;
|
1028
1006
|
_test_eof44: cs = 44; goto _test_eof;
|
1029
1007
|
_test_eof45: cs = 45; goto _test_eof;
|
1030
|
-
_test_eof46: cs = 46; goto _test_eof;
|
1031
1008
|
|
1032
1009
|
_test_eof: {}
|
1033
1010
|
_out: {}
|