puma 4.3.8-java → 5.0.0.beta1-java

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.

Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +58 -21
  3. data/LICENSE +23 -20
  4. data/README.md +17 -11
  5. data/docs/deployment.md +3 -1
  6. data/docs/fork_worker.md +31 -0
  7. data/docs/jungle/README.md +13 -0
  8. data/{tools → docs}/jungle/rc.d/README.md +0 -0
  9. data/{tools → docs}/jungle/rc.d/puma +0 -0
  10. data/{tools → docs}/jungle/rc.d/puma.conf +0 -0
  11. data/{tools → docs}/jungle/upstart/README.md +0 -0
  12. data/{tools → docs}/jungle/upstart/puma-manager.conf +0 -0
  13. data/{tools → docs}/jungle/upstart/puma.conf +0 -0
  14. data/docs/signals.md +1 -0
  15. data/docs/systemd.md +1 -63
  16. data/ext/puma_http11/PumaHttp11Service.java +2 -4
  17. data/ext/puma_http11/extconf.rb +3 -2
  18. data/ext/puma_http11/http11_parser.c +65 -67
  19. data/ext/puma_http11/http11_parser.rl +1 -3
  20. data/ext/puma_http11/org/jruby/puma/Http11.java +3 -3
  21. data/ext/puma_http11/puma_http11.c +2 -38
  22. data/lib/puma.rb +4 -0
  23. data/lib/puma/app/status.rb +16 -5
  24. data/lib/puma/binder.rb +62 -60
  25. data/lib/puma/cli.rb +7 -15
  26. data/lib/puma/client.rb +35 -32
  27. data/lib/puma/cluster.rb +179 -74
  28. data/lib/puma/configuration.rb +30 -42
  29. data/lib/puma/const.rb +2 -3
  30. data/lib/puma/control_cli.rb +27 -17
  31. data/lib/puma/detect.rb +8 -0
  32. data/lib/puma/dsl.rb +70 -34
  33. data/lib/puma/io_buffer.rb +9 -2
  34. data/lib/puma/jruby_restart.rb +0 -58
  35. data/lib/puma/launcher.rb +41 -29
  36. data/lib/puma/minissl.rb +13 -8
  37. data/lib/puma/null_io.rb +1 -1
  38. data/lib/puma/plugin.rb +1 -10
  39. data/lib/puma/puma_http11.jar +0 -0
  40. data/lib/puma/rack/builder.rb +0 -4
  41. data/lib/puma/reactor.rb +6 -1
  42. data/lib/puma/runner.rb +5 -34
  43. data/lib/puma/server.rb +70 -190
  44. data/lib/puma/single.rb +7 -64
  45. data/lib/puma/state_file.rb +5 -2
  46. data/lib/puma/thread_pool.rb +85 -47
  47. data/lib/rack/handler/puma.rb +1 -3
  48. data/tools/{docker/Dockerfile → Dockerfile} +0 -0
  49. metadata +18 -22
  50. data/docs/tcp_mode.md +0 -96
  51. data/ext/puma_http11/io_buffer.c +0 -155
  52. data/ext/puma_http11/org/jruby/puma/IOBuffer.java +0 -72
  53. data/lib/puma/tcp_logger.rb +0 -41
  54. data/tools/jungle/README.md +0 -19
  55. data/tools/jungle/init.d/README.md +0 -61
  56. data/tools/jungle/init.d/puma +0 -421
  57. data/tools/jungle/init.d/run-puma +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a86197f9a6b76dd7fdfe5799ee9634add99e2b9afe6573906ff46e652949ed97
4
- data.tar.gz: e1c3e118532315e9eb6fe157da8f1a4bd506cb3799d394e64022c5278976ae02
3
+ metadata.gz: '09ef3cad103c15def59126249335a202c405d8dee7cdc57bc62552bcea8fba22'
4
+ data.tar.gz: ce3bb06f5c36c12af2d699654f59f59ed6696e0139f8e518c1063315b7b476ae
5
5
  SHA512:
6
- metadata.gz: b40b5c0e8d308c3885f4eccec2c1baadc4221fadefc2935e80afc433dc0c5e9291fd0f86c1ea4f8d6c74b6a6615014ed74cce3a91fd50dffeabc8429d2ebcc68
7
- data.tar.gz: a8b93d83c107c27b74da1bd7b15cd5e13083a41211cd853855895af7369286f2babd3081f409f4b7a7085cb4f90e32fd4d3ef3a110da3531e40dca1d3fa851e6
6
+ metadata.gz: 0e8960a5b91862adc3ad60c801846c230de779c6c09e1151be1e22096721067a087e55f3b10055448feaa45950629348fab3ef836ca4aa3aebb9898797bfcd41
7
+ data.tar.gz: ebd533e470660608154f34a13cdbda6513ac02062a1fcaaa1525c80dd0380cbbf524c09e5a7c985e484dc30f5d30080de1045d25aec4a0f1adfe4d1d7c2e42f5
data/History.md CHANGED
@@ -1,31 +1,68 @@
1
- ## 4.3.8 / 2021-05-11
1
+ ## 5.0.0
2
2
 
3
- * Security
4
- * Close keepalive connections after the maximum number of fast inlined requests (#2625)
5
-
6
- ## 4.3.7 / 2020-11-30
3
+ * Features
4
+ * EXPERIMENTAL: Add `fork_worker` option and `refork` command for reduced memory usage by forking from a worker process instead of the master process. (#2099)
5
+ * EXPERIMENTAL: Added `wait_for_less_busy_worker` config. This may reduce latency on MRI through inserting a small delay before re-listening on the socket if worker is busy (#2079).
6
+ * EXPERIMENTAL: Added `nakayoshi_fork` option. Reduce memory usage in preloaded cluster-mode apps by GCing before fork and compacting, where available. (#2093, #2256)
7
+ * Added pumactl `thread-backtraces` command to print thread backtraces (#2054)
8
+ * Added incrementing `requests_count` to `Puma.stats`. (#2106)
9
+ * Increased maximum URI path length from 2048 to 8196 bytes (#2167)
10
+ * `lowlevel_error_handler` is now called during a forced threadpool shutdown, and if a callable with 3 arguments is set, we now also pass the status code (#2203)
11
+ * Faster phased restart and worker timeout (#2220)
12
+ * Added `state_permission` to config DSL to set state file permissions (#2238)
13
+ * Added `Puma.stats_hash`, which returns a stats in Hash instead of a JSON string (#2086, #2253)
14
+
15
+ * Deprecations, Removals and Breaking API Changes
16
+ * `--control` has been removed. Use `--control-url` (#1487)
17
+ * `worker_directory` has been removed. Use `directory`.
18
+ * min_threads now set by environment variables PUMA_MIN_THREADS and MIN_THREADS. (#2143)
19
+ * max_threads now set by environment variables PUMA_MAX_THREADS and MAX_THREADS. (#2143)
20
+ * max_threads default to 5 in MRI or 16 for all other interpreters. (#2143)
21
+ * preload by default if workers > 1 (#2143)
22
+ * Puma::Plugin.workers_supported? has been removed. Use Puma.forkable? instead. (#2143)
23
+ * `tcp_mode` has been removed without replacement. (#2169)
24
+ * Daemonization has been removed without replacement. (#2170)
25
+ * Changed #connected_port to #connected_ports (#2076)
26
+ * Configuration: `environment` is read from `RAILS_ENV`, if `RACK_ENV` can't be found (#2022)
7
27
 
8
28
  * Bugfixes
9
- * Backport set CONTENT_LENGTH for chunked requests (Originally: #2287, backport: #2496)
29
+ * Do not set user_config to quiet by default to allow for file config (#2074)
30
+ * Always close SSL connection in Puma::ControlCLI (#2211)
31
+ * Windows update extconf.rb for use with ssp and varied Ruby/MSYS2 combinations (#2069)
32
+ * Ensure control server Unix socket is closed on shutdown (#2112)
33
+ * Preserve `BUNDLE_GEMFILE` env var when using `prune_bundler` (#1893)
34
+ * Send 408 request timeout even when queue requests is disabled (#2119)
35
+ * Rescue IO::WaitReadable instead of EAGAIN for blocking read (#2121)
36
+ * Ensure `BUNDLE_GEMFILE` is unspecified in workers if unspecified in master when using `prune_bundler` (#2154)
37
+ * Rescue and log exceptions in hooks defined by users (on_worker_boot, after_worker_fork etc) (#1551)
38
+ * Read directly from the socket in #read_and_drop to avoid raising further SSL errors (#2198)
39
+ * Set `Connection: closed` header when queue requests is disabled (#2216)
40
+ * Pass queued requests to thread pool on server shutdown (#2122)
41
+ * Fixed a few minor concurrency bugs in ThreadPool that may have affected non-GVL Rubies (#2220)
42
+ * Fix `out_of_band` hook never executed if the number of worker threads is > 1 (#2177)
43
+ * Fix ThreadPool#shutdown timeout accuracy (#2221)
44
+ * Fix `UserFileDefaultOptions#fetch` to properly use `default` (#2233)
45
+ * Improvements to `out_of_band` hook (#2234)
46
+ * Prefer the rackup file specified by the CLI (#2225)
47
+
48
+ * Refactor
49
+ * Remove unused loader argument from Plugin initializer (#2095)
50
+ * Simplify `Configuration.random_token` and remove insecure fallback (#2102)
51
+ * Simplify `Runner#start_control` URL parsing (#2111)
52
+ * Removed the IOBuffer extension and replaced with Ruby (#1980)
53
+ * Update `Rack::Handler::Puma.run` to use `**options` (#2189)
54
+ * ThreadPool concurrency refactoring (#2220)
55
+ * JSON parse cluster worker stats instead of regex (#2124)
56
+ * Support parallel tests in verbose progress reporting (#2223)
10
57
 
11
- ## 4.3.6 / 2020-09-05
58
+ ## 4.3.3 and 3.12.4 / 2020-02-28
12
59
 
13
60
  * Bugfixes
14
- * Explicitly include ctype.h to fix compilation warning and build error on macOS with Xcode 12 (#2304)
15
- * Don't require json at boot (#2269)
16
- * Set `CONTENT_LENGTH` for chunked requests (#2287)
17
-
18
- ## 4.3.4/4.3.5 and 3.12.5/3.12.6 / 2020-05-22
19
-
20
- Each patchlevel release contains a separate security fix. We recommend simply upgrading to 4.3.5/3.12.6.
21
-
22
- ## 4.3.3 and 3.12.4 / 2020-02-28
23
- * Bugfixes
24
- * Fix: Fixes a problem where we weren't splitting headers correctly on newlines (#2132)
25
- * Security
26
- * Fix: Prevent HTTP Response splitting via CR in early hints.
61
+ * Fix: Fixes a problem where we weren't splitting headers correctly on newlines (#2132)
62
+ * Security
63
+ * Fix: Prevent HTTP Response splitting via CR in early hints. CVE-2020-5249.
27
64
 
28
- ## 4.3.2 and 3.12.3 / 2020-02-27
65
+ ## 4.3.2 and 3.12.3 / 2020-02-27 (YANKED)
29
66
 
30
67
  * Security
31
68
  * Fix: Prevent HTTP Response splitting via CR/LF in header values. CVE-2020-5247.
data/LICENSE CHANGED
@@ -1,26 +1,29 @@
1
- Some code copyright (c) 2005, Zed Shaw
2
- Copyright (c) 2011, Evan Phoenix
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2019, Evan Phoenix. Some code by Zed Shaw, (c) 2005.
3
4
  All rights reserved.
4
5
 
5
- Redistribution and use in source and binary forms, with or without
6
+ Redistribution and use in source and binary forms, with or without
6
7
  modification, are permitted provided that the following conditions are met:
7
8
 
8
- * Redistributions of source code must retain the above copyright notice, this
9
- list of conditions and the following disclaimer.
10
- * Redistributions in binary form must reproduce the above copyright notice
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
13
- * Neither the name of the Evan Phoenix nor the names of its contributors
14
- may be used to endorse or promote products derived from this software
15
- without specific prior written permission.
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
16
19
 
17
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
21
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
29
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -4,12 +4,11 @@
4
4
 
5
5
  # Puma: A Ruby Web Server Built For Concurrency
6
6
 
7
- [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/puma/puma?utm\_source=badge&utm\_medium=badge&utm\_campaign=pr-badge)
8
- [![Actions Build Status](https://github.com/puma/puma/workflows/Puma/badge.svg)](https://github.com/puma/puma/actions)
9
- [![Travis Build Status](https://travis-ci.org/puma/puma.svg?branch=master)](https://travis-ci.org/puma/puma)
7
+ [![Actions Build Status](https://github.com/puma/puma/workflows/CI/badge.svg?branch=master)](https://github.com/puma/puma/actions)
10
8
 
11
9
  [![Code Climate](https://codeclimate.com/github/puma/puma.svg)](https://codeclimate.com/github/puma/puma)
12
10
  [![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=puma&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=puma&package-manager=bundler&version-scheme=semver)
11
+ [![StackOverflow](http://img.shields.io/badge/stackoverflow-Puma-blue.svg)]( http://stackoverflow.com/questions/tagged/puma )
13
12
 
14
13
  Puma is a **simple, fast, multi-threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications**.
15
14
 
@@ -28,7 +27,8 @@ $ gem install puma
28
27
  $ puma
29
28
  ```
30
29
 
31
- Without arguments, puma will look for a rackup (.ru) file in the current working directory called `config.ru`.
30
+ Without arguments, puma will look for a rackup (.ru) file in
31
+ working directory called `config.ru`.
32
32
 
33
33
  ## Frameworks
34
34
 
@@ -68,7 +68,7 @@ configure { set :server, :puma }
68
68
  Puma provides numerous options. Consult `puma -h` (or `puma --help`) for a full list of CLI options, or see [dsl.rb](https://github.com/puma/puma/blob/master/lib/puma/dsl.rb).
69
69
 
70
70
  You can also find several configuration examples as part of the
71
- [test](test/config) suite.
71
+ [test](https://github.com/puma/puma/tree/master/test/config) suite.
72
72
 
73
73
  ### Thread Pool
74
74
 
@@ -78,7 +78,7 @@ Puma uses a thread pool. You can set the minimum and maximum number of threads t
78
78
  $ puma -t 8:32
79
79
  ```
80
80
 
81
- Puma will automatically scale the number of threads, from the minimum until it caps out at the maximum, based on how much traffic is present. The current default is `0:16`. Feel free to experiment, but be careful not to set the number of maximum threads to a large number, as you may exhaust resources on the system (or cause contention for the Global VM Lock, when using MRI).
81
+ Puma will automatically scale the number of threads, from the minimum until it caps out at the maximum, based on how much traffic is present. The current default is `0:16` and on MRI is `0:5`. Feel free to experiment, but be careful not to set the number of maximum threads to a large number, as you may exhaust resources on the system (or cause contention for the Global VM Lock, when using MRI).
82
82
 
83
83
  Be aware that additionally Puma creates threads on its own for internal purposes (e.g. handling slow clients). So, even if you specify -t 1:1, expect around 7 threads created in your application.
84
84
 
@@ -220,7 +220,7 @@ You can also provide a configuration file with the `-C` (or `--config`) flag:
220
220
  $ puma -C /path/to/config
221
221
  ```
222
222
 
223
- If no configuration file is specified, Puma will look for a configuration file at `config/puma.rb`. If an environment is specified, either via the `-e` and `--environment` flags, or through the `RACK_ENV` environment variable, Puma looks for configuration at `config/puma/<environment_name>.rb`.
223
+ If no configuration file is specified, Puma will look for a configuration file at `config/puma.rb`. If an environment is specified, either via the `-e` and `--environment` flags, or through the `RACK_ENV` or the `RAILS_ENV` environment variables, Puma looks for configuration at `config/puma/<environment_name>.rb`.
224
224
 
225
225
  If you want to prevent Puma from looking for a configuration file in those locations, provide a dash as the argument to the `-C` (or `--config`) flag:
226
226
 
@@ -251,7 +251,7 @@ Some platforms do not support all Puma features.
251
251
 
252
252
  ## Known Bugs
253
253
 
254
- For MRI versions 2.2.7, 2.2.8, 2.2.9, 2.2.10 2.3.4 and 2.4.1, you may see ```stream closed in another thread (IOError)```. It may be caused by a [Ruby bug](https://bugs.ruby-lang.org/issues/13632). It can be fixed with the gem https://rubygems.org/gems/stopgap_13632:
254
+ For MRI versions 2.2.7, 2.2.8, 2.2.9, 2.2.10, 2.3.4 and 2.4.1, you may see ```stream closed in another thread (IOError)```. It may be caused by a [Ruby bug](https://bugs.ruby-lang.org/issues/13632). It can be fixed with the gem https://rubygems.org/gems/stopgap_13632:
255
255
 
256
256
  ```ruby
257
257
  if %w(2.2.7 2.2.8 2.2.9 2.2.10 2.3.4 2.4.1).include? RUBY_VERSION
@@ -270,16 +270,22 @@ It is common to use process monitors with Puma. Modern process monitors like sys
270
270
  provide continuous monitoring and restarts for increased
271
271
  reliability in production environments:
272
272
 
273
- * [tools/jungle](https://github.com/puma/puma/tree/master/tools/jungle) for sysvinit (init.d) and upstart
273
+ * [docs/jungle](https://github.com/puma/puma/tree/master/docs/jungle) for rc.d and upstart
274
274
  * [docs/systemd](https://github.com/puma/puma/blob/master/docs/systemd.md)
275
275
 
276
- ## Community Plugins
276
+ ## Community Extensions
277
277
 
278
- * [puma-heroku](https://github.com/evanphx/puma-heroku) — default Puma configuration for running on Heroku
278
+ ### Plugins
279
+
280
+ * [puma-heroku](https://github.com/puma/puma-heroku) — default Puma configuration for running on Heroku
279
281
  * [puma-metrics](https://github.com/harmjanblok/puma-metrics) — export Puma metrics to Prometheus
280
282
  * [puma-plugin-statsd](https://github.com/yob/puma-plugin-statsd) — send Puma metrics to statsd
281
283
  * [puma-plugin-systemd](https://github.com/sj26/puma-plugin-systemd) — deeper integration with systemd for notify, status and watchdog
282
284
 
285
+ ### Monitoring
286
+
287
+ * [puma-status](https://github.com/ylecuyer/puma-status) — Monitor CPU/Mem/Load of running puma instances from the CLI
288
+
283
289
  ## Contributing
284
290
 
285
291
  Find details for contributing in the [contribution guide].
data/docs/deployment.md CHANGED
@@ -74,7 +74,9 @@ thread to become available.
74
74
  * haproxy: `%Th` (TLS handshake time) and `%Ti` (idle time before request) can
75
75
  can also be added as headers.
76
76
 
77
- ## Daemonizing
77
+ ## Should I daemonize?
78
+
79
+ Daemonization was removed in Puma 5.0. For alternatives, continue reading.
78
80
 
79
81
  I prefer to not daemonize my servers and use something like `runit` or `upstart` to
80
82
  monitor them as child processes. This gives them fast response to crashes and
@@ -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/signals.md CHANGED
@@ -41,6 +41,7 @@ Puma cluster responds to these signals:
41
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
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). See also, the
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
  }
@@ -1,9 +1,10 @@
1
1
  require 'mkmf'
2
2
 
3
3
  dir_config("puma_http11")
4
+
4
5
  if $mingw && RUBY_VERSION >= '2.4'
5
- append_cflags '-D_FORTIFY_SOURCE=2'
6
- append_ldflags '-fstack-protector'
6
+ append_cflags '-fstack-protector-strong -D_FORTIFY_SOURCE=2'
7
+ append_ldflags '-fstack-protector-strong -l:libssp.a'
7
8
  have_library 'ssp'
8
9
  end
9
10
 
@@ -14,14 +14,12 @@
14
14
 
15
15
  /*
16
16
  * capitalizes all lower-case ASCII characters,
17
- * converts dashes to underscores, and underscores to commas.
17
+ * converts dashes to underscores.
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 = ',';
25
23
  else if (*c == '-')
26
24
  *c = '_';
27
25
  }
@@ -33,12 +31,12 @@ static void snake_upcase_char(char *c)
33
31
  /** Machine **/
34
32
 
35
33
 
36
- #line 81 "ext/puma_http11/http11_parser.rl"
34
+ #line 79 "ext/puma_http11/http11_parser.rl"
37
35
 
38
36
 
39
37
  /** Data **/
40
38
 
41
- #line 42 "ext/puma_http11/http11_parser.c"
39
+ #line 40 "ext/puma_http11/http11_parser.c"
42
40
  static const int puma_parser_start = 1;
43
41
  static const int puma_parser_first_final = 46;
44
42
  static const int puma_parser_error = 0;
@@ -46,17 +44,17 @@ static const int puma_parser_error = 0;
46
44
  static const int puma_parser_en_main = 1;
47
45
 
48
46
 
49
- #line 85 "ext/puma_http11/http11_parser.rl"
47
+ #line 83 "ext/puma_http11/http11_parser.rl"
50
48
 
51
49
  int puma_parser_init(puma_parser *parser) {
52
50
  int cs = 0;
53
51
 
54
- #line 55 "ext/puma_http11/http11_parser.c"
52
+ #line 53 "ext/puma_http11/http11_parser.c"
55
53
  {
56
54
  cs = puma_parser_start;
57
55
  }
58
56
 
59
- #line 89 "ext/puma_http11/http11_parser.rl"
57
+ #line 87 "ext/puma_http11/http11_parser.rl"
60
58
  parser->cs = cs;
61
59
  parser->body_start = 0;
62
60
  parser->content_len = 0;
@@ -85,7 +83,7 @@ size_t puma_parser_execute(puma_parser *parser, const char *buffer, size_t len,
85
83
  assert((size_t) (pe - p) == len - off && "pointers aren't same distance");
86
84
 
87
85
 
88
- #line 89 "ext/puma_http11/http11_parser.c"
86
+ #line 87 "ext/puma_http11/http11_parser.c"
89
87
  {
90
88
  if ( p == pe )
91
89
  goto _test_eof;
@@ -109,14 +107,14 @@ st0:
109
107
  cs = 0;
110
108
  goto _out;
111
109
  tr0:
112
- #line 37 "ext/puma_http11/http11_parser.rl"
110
+ #line 35 "ext/puma_http11/http11_parser.rl"
113
111
  { MARK(mark, p); }
114
112
  goto st2;
115
113
  st2:
116
114
  if ( ++p == pe )
117
115
  goto _test_eof2;
118
116
  case 2:
119
- #line 120 "ext/puma_http11/http11_parser.c"
117
+ #line 118 "ext/puma_http11/http11_parser.c"
120
118
  switch( (*p) ) {
121
119
  case 32: goto tr2;
122
120
  case 36: goto st27;
@@ -132,7 +130,7 @@ case 2:
132
130
  goto st27;
133
131
  goto st0;
134
132
  tr2:
135
- #line 50 "ext/puma_http11/http11_parser.rl"
133
+ #line 48 "ext/puma_http11/http11_parser.rl"
136
134
  {
137
135
  parser->request_method(parser, PTR_TO(mark), LEN(mark, p));
138
136
  }
@@ -141,7 +139,7 @@ st3:
141
139
  if ( ++p == pe )
142
140
  goto _test_eof3;
143
141
  case 3:
144
- #line 145 "ext/puma_http11/http11_parser.c"
142
+ #line 143 "ext/puma_http11/http11_parser.c"
145
143
  switch( (*p) ) {
146
144
  case 42: goto tr4;
147
145
  case 43: goto tr5;
@@ -158,67 +156,67 @@ case 3:
158
156
  goto tr5;
159
157
  goto st0;
160
158
  tr4:
161
- #line 37 "ext/puma_http11/http11_parser.rl"
159
+ #line 35 "ext/puma_http11/http11_parser.rl"
162
160
  { MARK(mark, p); }
163
161
  goto st4;
164
162
  st4:
165
163
  if ( ++p == pe )
166
164
  goto _test_eof4;
167
165
  case 4:
168
- #line 169 "ext/puma_http11/http11_parser.c"
166
+ #line 167 "ext/puma_http11/http11_parser.c"
169
167
  switch( (*p) ) {
170
168
  case 32: goto tr8;
171
169
  case 35: goto tr9;
172
170
  }
173
171
  goto st0;
174
172
  tr8:
175
- #line 53 "ext/puma_http11/http11_parser.rl"
173
+ #line 51 "ext/puma_http11/http11_parser.rl"
176
174
  {
177
175
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
178
176
  }
179
177
  goto st5;
180
178
  tr31:
181
- #line 37 "ext/puma_http11/http11_parser.rl"
179
+ #line 35 "ext/puma_http11/http11_parser.rl"
182
180
  { MARK(mark, p); }
183
- #line 56 "ext/puma_http11/http11_parser.rl"
181
+ #line 54 "ext/puma_http11/http11_parser.rl"
184
182
  {
185
183
  parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
186
184
  }
187
185
  goto st5;
188
186
  tr33:
189
- #line 56 "ext/puma_http11/http11_parser.rl"
187
+ #line 54 "ext/puma_http11/http11_parser.rl"
190
188
  {
191
189
  parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
192
190
  }
193
191
  goto st5;
194
192
  tr37:
195
- #line 69 "ext/puma_http11/http11_parser.rl"
193
+ #line 67 "ext/puma_http11/http11_parser.rl"
196
194
  {
197
195
  parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
198
196
  }
199
- #line 53 "ext/puma_http11/http11_parser.rl"
197
+ #line 51 "ext/puma_http11/http11_parser.rl"
200
198
  {
201
199
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
202
200
  }
203
201
  goto st5;
204
202
  tr41:
205
- #line 60 "ext/puma_http11/http11_parser.rl"
203
+ #line 58 "ext/puma_http11/http11_parser.rl"
206
204
  { MARK(query_start, p); }
207
- #line 61 "ext/puma_http11/http11_parser.rl"
205
+ #line 59 "ext/puma_http11/http11_parser.rl"
208
206
  {
209
207
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
210
208
  }
211
- #line 53 "ext/puma_http11/http11_parser.rl"
209
+ #line 51 "ext/puma_http11/http11_parser.rl"
212
210
  {
213
211
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
214
212
  }
215
213
  goto st5;
216
214
  tr44:
217
- #line 61 "ext/puma_http11/http11_parser.rl"
215
+ #line 59 "ext/puma_http11/http11_parser.rl"
218
216
  {
219
217
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
220
218
  }
221
- #line 53 "ext/puma_http11/http11_parser.rl"
219
+ #line 51 "ext/puma_http11/http11_parser.rl"
222
220
  {
223
221
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
224
222
  }
@@ -227,19 +225,19 @@ st5:
227
225
  if ( ++p == pe )
228
226
  goto _test_eof5;
229
227
  case 5:
230
- #line 231 "ext/puma_http11/http11_parser.c"
228
+ #line 229 "ext/puma_http11/http11_parser.c"
231
229
  if ( (*p) == 72 )
232
230
  goto tr10;
233
231
  goto st0;
234
232
  tr10:
235
- #line 37 "ext/puma_http11/http11_parser.rl"
233
+ #line 35 "ext/puma_http11/http11_parser.rl"
236
234
  { MARK(mark, p); }
237
235
  goto st6;
238
236
  st6:
239
237
  if ( ++p == pe )
240
238
  goto _test_eof6;
241
239
  case 6:
242
- #line 243 "ext/puma_http11/http11_parser.c"
240
+ #line 241 "ext/puma_http11/http11_parser.c"
243
241
  if ( (*p) == 84 )
244
242
  goto st7;
245
243
  goto st0;
@@ -297,21 +295,21 @@ case 13:
297
295
  goto st13;
298
296
  goto st0;
299
297
  tr18:
300
- #line 65 "ext/puma_http11/http11_parser.rl"
298
+ #line 63 "ext/puma_http11/http11_parser.rl"
301
299
  {
302
300
  parser->http_version(parser, PTR_TO(mark), LEN(mark, p));
303
301
  }
304
302
  goto st14;
305
303
  tr26:
306
- #line 46 "ext/puma_http11/http11_parser.rl"
304
+ #line 44 "ext/puma_http11/http11_parser.rl"
307
305
  { MARK(mark, p); }
308
- #line 47 "ext/puma_http11/http11_parser.rl"
306
+ #line 45 "ext/puma_http11/http11_parser.rl"
309
307
  {
310
308
  parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
311
309
  }
312
310
  goto st14;
313
311
  tr29:
314
- #line 47 "ext/puma_http11/http11_parser.rl"
312
+ #line 45 "ext/puma_http11/http11_parser.rl"
315
313
  {
316
314
  parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
317
315
  }
@@ -320,7 +318,7 @@ st14:
320
318
  if ( ++p == pe )
321
319
  goto _test_eof14;
322
320
  case 14:
323
- #line 324 "ext/puma_http11/http11_parser.c"
321
+ #line 322 "ext/puma_http11/http11_parser.c"
324
322
  if ( (*p) == 10 )
325
323
  goto st15;
326
324
  goto st0;
@@ -360,7 +358,7 @@ case 16:
360
358
  goto tr22;
361
359
  goto st0;
362
360
  tr22:
363
- #line 73 "ext/puma_http11/http11_parser.rl"
361
+ #line 71 "ext/puma_http11/http11_parser.rl"
364
362
  {
365
363
  parser->body_start = p - buffer + 1;
366
364
  parser->header_done(parser, p + 1, pe - p - 1);
@@ -371,23 +369,23 @@ st46:
371
369
  if ( ++p == pe )
372
370
  goto _test_eof46;
373
371
  case 46:
374
- #line 375 "ext/puma_http11/http11_parser.c"
372
+ #line 373 "ext/puma_http11/http11_parser.c"
375
373
  goto st0;
376
374
  tr21:
377
- #line 40 "ext/puma_http11/http11_parser.rl"
375
+ #line 38 "ext/puma_http11/http11_parser.rl"
378
376
  { MARK(field_start, p); }
379
- #line 41 "ext/puma_http11/http11_parser.rl"
377
+ #line 39 "ext/puma_http11/http11_parser.rl"
380
378
  { snake_upcase_char((char *)p); }
381
379
  goto st17;
382
380
  tr23:
383
- #line 41 "ext/puma_http11/http11_parser.rl"
381
+ #line 39 "ext/puma_http11/http11_parser.rl"
384
382
  { snake_upcase_char((char *)p); }
385
383
  goto st17;
386
384
  st17:
387
385
  if ( ++p == pe )
388
386
  goto _test_eof17;
389
387
  case 17:
390
- #line 391 "ext/puma_http11/http11_parser.c"
388
+ #line 389 "ext/puma_http11/http11_parser.c"
391
389
  switch( (*p) ) {
392
390
  case 33: goto tr23;
393
391
  case 58: goto tr24;
@@ -413,71 +411,71 @@ case 17:
413
411
  goto tr23;
414
412
  goto st0;
415
413
  tr24:
416
- #line 42 "ext/puma_http11/http11_parser.rl"
414
+ #line 40 "ext/puma_http11/http11_parser.rl"
417
415
  {
418
416
  parser->field_len = LEN(field_start, p);
419
417
  }
420
418
  goto st18;
421
419
  tr27:
422
- #line 46 "ext/puma_http11/http11_parser.rl"
420
+ #line 44 "ext/puma_http11/http11_parser.rl"
423
421
  { MARK(mark, p); }
424
422
  goto st18;
425
423
  st18:
426
424
  if ( ++p == pe )
427
425
  goto _test_eof18;
428
426
  case 18:
429
- #line 430 "ext/puma_http11/http11_parser.c"
427
+ #line 428 "ext/puma_http11/http11_parser.c"
430
428
  switch( (*p) ) {
431
429
  case 13: goto tr26;
432
430
  case 32: goto tr27;
433
431
  }
434
432
  goto tr25;
435
433
  tr25:
436
- #line 46 "ext/puma_http11/http11_parser.rl"
434
+ #line 44 "ext/puma_http11/http11_parser.rl"
437
435
  { MARK(mark, p); }
438
436
  goto st19;
439
437
  st19:
440
438
  if ( ++p == pe )
441
439
  goto _test_eof19;
442
440
  case 19:
443
- #line 444 "ext/puma_http11/http11_parser.c"
441
+ #line 442 "ext/puma_http11/http11_parser.c"
444
442
  if ( (*p) == 13 )
445
443
  goto tr29;
446
444
  goto st19;
447
445
  tr9:
448
- #line 53 "ext/puma_http11/http11_parser.rl"
446
+ #line 51 "ext/puma_http11/http11_parser.rl"
449
447
  {
450
448
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
451
449
  }
452
450
  goto st20;
453
451
  tr38:
454
- #line 69 "ext/puma_http11/http11_parser.rl"
452
+ #line 67 "ext/puma_http11/http11_parser.rl"
455
453
  {
456
454
  parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
457
455
  }
458
- #line 53 "ext/puma_http11/http11_parser.rl"
456
+ #line 51 "ext/puma_http11/http11_parser.rl"
459
457
  {
460
458
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
461
459
  }
462
460
  goto st20;
463
461
  tr42:
464
- #line 60 "ext/puma_http11/http11_parser.rl"
462
+ #line 58 "ext/puma_http11/http11_parser.rl"
465
463
  { MARK(query_start, p); }
466
- #line 61 "ext/puma_http11/http11_parser.rl"
464
+ #line 59 "ext/puma_http11/http11_parser.rl"
467
465
  {
468
466
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
469
467
  }
470
- #line 53 "ext/puma_http11/http11_parser.rl"
468
+ #line 51 "ext/puma_http11/http11_parser.rl"
471
469
  {
472
470
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
473
471
  }
474
472
  goto st20;
475
473
  tr45:
476
- #line 61 "ext/puma_http11/http11_parser.rl"
474
+ #line 59 "ext/puma_http11/http11_parser.rl"
477
475
  {
478
476
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
479
477
  }
480
- #line 53 "ext/puma_http11/http11_parser.rl"
478
+ #line 51 "ext/puma_http11/http11_parser.rl"
481
479
  {
482
480
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
483
481
  }
@@ -486,7 +484,7 @@ st20:
486
484
  if ( ++p == pe )
487
485
  goto _test_eof20;
488
486
  case 20:
489
- #line 490 "ext/puma_http11/http11_parser.c"
487
+ #line 488 "ext/puma_http11/http11_parser.c"
490
488
  switch( (*p) ) {
491
489
  case 32: goto tr31;
492
490
  case 60: goto st0;
@@ -500,14 +498,14 @@ case 20:
500
498
  goto st0;
501
499
  goto tr30;
502
500
  tr30:
503
- #line 37 "ext/puma_http11/http11_parser.rl"
501
+ #line 35 "ext/puma_http11/http11_parser.rl"
504
502
  { MARK(mark, p); }
505
503
  goto st21;
506
504
  st21:
507
505
  if ( ++p == pe )
508
506
  goto _test_eof21;
509
507
  case 21:
510
- #line 511 "ext/puma_http11/http11_parser.c"
508
+ #line 509 "ext/puma_http11/http11_parser.c"
511
509
  switch( (*p) ) {
512
510
  case 32: goto tr33;
513
511
  case 60: goto st0;
@@ -521,14 +519,14 @@ case 21:
521
519
  goto st0;
522
520
  goto st21;
523
521
  tr5:
524
- #line 37 "ext/puma_http11/http11_parser.rl"
522
+ #line 35 "ext/puma_http11/http11_parser.rl"
525
523
  { MARK(mark, p); }
526
524
  goto st22;
527
525
  st22:
528
526
  if ( ++p == pe )
529
527
  goto _test_eof22;
530
528
  case 22:
531
- #line 532 "ext/puma_http11/http11_parser.c"
529
+ #line 530 "ext/puma_http11/http11_parser.c"
532
530
  switch( (*p) ) {
533
531
  case 43: goto st22;
534
532
  case 58: goto st23;
@@ -546,14 +544,14 @@ case 22:
546
544
  goto st22;
547
545
  goto st0;
548
546
  tr7:
549
- #line 37 "ext/puma_http11/http11_parser.rl"
547
+ #line 35 "ext/puma_http11/http11_parser.rl"
550
548
  { MARK(mark, p); }
551
549
  goto st23;
552
550
  st23:
553
551
  if ( ++p == pe )
554
552
  goto _test_eof23;
555
553
  case 23:
556
- #line 557 "ext/puma_http11/http11_parser.c"
554
+ #line 555 "ext/puma_http11/http11_parser.c"
557
555
  switch( (*p) ) {
558
556
  case 32: goto tr8;
559
557
  case 34: goto st0;
@@ -566,14 +564,14 @@ case 23:
566
564
  goto st0;
567
565
  goto st23;
568
566
  tr6:
569
- #line 37 "ext/puma_http11/http11_parser.rl"
567
+ #line 35 "ext/puma_http11/http11_parser.rl"
570
568
  { MARK(mark, p); }
571
569
  goto st24;
572
570
  st24:
573
571
  if ( ++p == pe )
574
572
  goto _test_eof24;
575
573
  case 24:
576
- #line 577 "ext/puma_http11/http11_parser.c"
574
+ #line 575 "ext/puma_http11/http11_parser.c"
577
575
  switch( (*p) ) {
578
576
  case 32: goto tr37;
579
577
  case 34: goto st0;
@@ -587,7 +585,7 @@ case 24:
587
585
  goto st0;
588
586
  goto st24;
589
587
  tr39:
590
- #line 69 "ext/puma_http11/http11_parser.rl"
588
+ #line 67 "ext/puma_http11/http11_parser.rl"
591
589
  {
592
590
  parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
593
591
  }
@@ -596,7 +594,7 @@ st25:
596
594
  if ( ++p == pe )
597
595
  goto _test_eof25;
598
596
  case 25:
599
- #line 600 "ext/puma_http11/http11_parser.c"
597
+ #line 598 "ext/puma_http11/http11_parser.c"
600
598
  switch( (*p) ) {
601
599
  case 32: goto tr41;
602
600
  case 34: goto st0;
@@ -609,14 +607,14 @@ case 25:
609
607
  goto st0;
610
608
  goto tr40;
611
609
  tr40:
612
- #line 60 "ext/puma_http11/http11_parser.rl"
610
+ #line 58 "ext/puma_http11/http11_parser.rl"
613
611
  { MARK(query_start, p); }
614
612
  goto st26;
615
613
  st26:
616
614
  if ( ++p == pe )
617
615
  goto _test_eof26;
618
616
  case 26:
619
- #line 620 "ext/puma_http11/http11_parser.c"
617
+ #line 618 "ext/puma_http11/http11_parser.c"
620
618
  switch( (*p) ) {
621
619
  case 32: goto tr44;
622
620
  case 34: goto st0;
@@ -1010,7 +1008,7 @@ case 45:
1010
1008
  _out: {}
1011
1009
  }
1012
1010
 
1013
- #line 117 "ext/puma_http11/http11_parser.rl"
1011
+ #line 115 "ext/puma_http11/http11_parser.rl"
1014
1012
 
1015
1013
  if (!puma_parser_has_error(parser))
1016
1014
  parser->cs = cs;