puma 2.16.0-java → 3.0.0-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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/History.txt +50 -0
- data/Manifest.txt +5 -1
- data/README.md +25 -13
- data/ext/puma_http11/http11_parser.java.rl +5 -5
- data/ext/puma_http11/io_buffer.c +1 -1
- data/ext/puma_http11/mini_ssl.c +7 -1
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +39 -39
- data/lib/puma.rb +1 -0
- data/lib/puma/app/status.rb +1 -1
- data/lib/puma/binder.rb +14 -3
- data/lib/puma/cli.rb +128 -493
- data/lib/puma/client.rb +4 -0
- data/lib/puma/cluster.rb +68 -52
- data/lib/puma/configuration.rb +192 -61
- data/lib/puma/const.rb +2 -2
- data/lib/puma/control_cli.rb +58 -73
- data/lib/puma/convenient.rb +23 -0
- data/lib/puma/daemon_ext.rb +6 -0
- data/lib/puma/detect.rb +8 -1
- data/lib/puma/dsl.rb +113 -28
- data/lib/puma/events.rb +5 -0
- data/lib/puma/launcher.rb +397 -0
- data/lib/puma/null_io.rb +15 -0
- data/lib/puma/plugin.rb +91 -0
- data/lib/puma/plugin/tmp_restart.rb +23 -0
- data/lib/puma/puma_http11.jar +0 -0
- data/lib/puma/runner.rb +19 -14
- data/lib/puma/server.rb +82 -48
- data/lib/puma/single.rb +9 -4
- data/lib/puma/state_file.rb +29 -0
- data/lib/puma/thread_pool.rb +8 -3
- data/lib/rack/handler/puma.rb +34 -27
- metadata +7 -3
- data/COPYING +0 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69f64076ecd1fa06c746e71e44eb434ecd0793cd
|
4
|
+
data.tar.gz: fb698f2745ee24731207d9322c0b137f54d9eb0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53f16055692cc03f8a26167433d22f25556664779130c14b26f708917e055e85b9b6bb1575da8da91327b142f5b8764101b968e1d9fa55190e0996d512863fb2
|
7
|
+
data.tar.gz: 8aa7f714ddf879e207f64d50a99d32d43f4c49727cde9360b4ba6f39ebe02340bf1b83b6fc75ac6c9222a5faf5409237d44c0e8940cf52defef3220bd9e2307a
|
data/Gemfile
CHANGED
data/History.txt
CHANGED
@@ -1,3 +1,53 @@
|
|
1
|
+
=== 3.0.0 / 2016-02-25
|
2
|
+
|
3
|
+
* 2 major changes:
|
4
|
+
|
5
|
+
* Ruby pre-2.0 is no longer supported. We'll do our best to not add
|
6
|
+
features that break those rubies but will no longer be testing
|
7
|
+
with them.
|
8
|
+
* Don't log requests by default. Fixes #852
|
9
|
+
|
10
|
+
* 2 major features:
|
11
|
+
|
12
|
+
* Plugin support! Plugins can interact with configuration as well
|
13
|
+
as provide augment server functionality!
|
14
|
+
* Experimental env['async.callback'] support
|
15
|
+
|
16
|
+
* 4 minor features:
|
17
|
+
|
18
|
+
* Listen to unix socket with provided backlog if any
|
19
|
+
* Improves the clustered stats to report worker stats
|
20
|
+
* Pass the env to the lowlevel_error handler. Fixes #854
|
21
|
+
* Treat path-like hosts as unix sockets. Fixes #824
|
22
|
+
|
23
|
+
* 5 bug fixes:
|
24
|
+
|
25
|
+
* Clean thread locals when using keepalive. Fixes #823
|
26
|
+
* Cleanup compiler warnings. Fixes #815
|
27
|
+
* Expose closed? for use by the reactor. Fixes #835
|
28
|
+
* Move signal handlers to separate method to prevent space leak. Fixes #798
|
29
|
+
* Signal not full on worker exit #876
|
30
|
+
|
31
|
+
* 5 doc fixes:
|
32
|
+
|
33
|
+
* Update README.md with various grammar fixes
|
34
|
+
* Use newest version of Minitest
|
35
|
+
* Add directory configuration docs, fix typo [ci skip]
|
36
|
+
* Remove old COPYING notice. Fixes #849
|
37
|
+
|
38
|
+
* 10 merged PRs:
|
39
|
+
|
40
|
+
* Merge pull request #871 from deepj/travis
|
41
|
+
* Merge pull request #874 from wallclockbuilder/master
|
42
|
+
* Merge pull request #883 from dadah89/igor/trim_only_worker
|
43
|
+
* Merge pull request #884 from uistudio/async-callback
|
44
|
+
* Merge pull request #888 from mlarraz/tick_minitest
|
45
|
+
* Merge pull request #890 from todd/directory_docs
|
46
|
+
* Merge pull request #891 from ctaintor/improve_clustered_status
|
47
|
+
* Merge pull request #893 from spastorino/add_missing_require
|
48
|
+
* Merge pull request #897 from zendesk/master
|
49
|
+
* Merge pull request #899 from kch/kch-readme-fixes
|
50
|
+
|
1
51
|
=== 2.16.0 / 2016-01-27
|
2
52
|
|
3
53
|
* 7 minor features:
|
data/Manifest.txt
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
COPYING
|
2
1
|
DEPLOYMENT.md
|
3
2
|
Gemfile
|
4
3
|
History.txt
|
@@ -39,6 +38,7 @@ lib/puma/compat.rb
|
|
39
38
|
lib/puma/configuration.rb
|
40
39
|
lib/puma/const.rb
|
41
40
|
lib/puma/control_cli.rb
|
41
|
+
lib/puma/convenient.rb
|
42
42
|
lib/puma/daemon_ext.rb
|
43
43
|
lib/puma/delegation.rb
|
44
44
|
lib/puma/detect.rb
|
@@ -47,8 +47,11 @@ lib/puma/events.rb
|
|
47
47
|
lib/puma/io_buffer.rb
|
48
48
|
lib/puma/java_io_buffer.rb
|
49
49
|
lib/puma/jruby_restart.rb
|
50
|
+
lib/puma/launcher.rb
|
50
51
|
lib/puma/minissl.rb
|
51
52
|
lib/puma/null_io.rb
|
53
|
+
lib/puma/plugin.rb
|
54
|
+
lib/puma/plugin/tmp_restart.rb
|
52
55
|
lib/puma/rack/backports/uri/common_18.rb
|
53
56
|
lib/puma/rack/backports/uri/common_192.rb
|
54
57
|
lib/puma/rack/backports/uri/common_193.rb
|
@@ -59,6 +62,7 @@ lib/puma/reactor.rb
|
|
59
62
|
lib/puma/runner.rb
|
60
63
|
lib/puma/server.rb
|
61
64
|
lib/puma/single.rb
|
65
|
+
lib/puma/state_file.rb
|
62
66
|
lib/puma/tcp_logger.rb
|
63
67
|
lib/puma/thread_pool.rb
|
64
68
|
lib/puma/util.rb
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# Puma: A Ruby Web Server Built For Concurrency
|
2
2
|
|
3
|
-
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/puma/puma?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
3
|
+
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/puma/puma?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
4
|
+
[![Build Status](https://secure.travis-ci.org/puma/puma.svg)](http://travis-ci.org/puma/puma)
|
5
|
+
[![Dependency Status](https://gemnasium.com/puma/puma.svg)](https://gemnasium.com/puma/puma)
|
6
|
+
[![Code Climate](https://codeclimate.com/github/puma/puma.svg)](https://codeclimate.com/github/puma/puma)
|
4
7
|
|
5
8
|
## Description
|
6
9
|
|
@@ -71,7 +74,7 @@ Puma utilizes a dynamic thread pool which you can modify. You can set the minimu
|
|
71
74
|
|
72
75
|
$ puma -t 8:32
|
73
76
|
|
74
|
-
Puma will automatically scale the number of threads 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 very large number, as you may exhaust resources on the system (or hit resource limits).
|
77
|
+
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 very large number, as you may exhaust resources on the system (or hit resource limits).
|
75
78
|
|
76
79
|
### Clustered mode
|
77
80
|
|
@@ -108,7 +111,7 @@ you to do some Puma-specific things that you don't want to embed in your applica
|
|
108
111
|
For instance, you could fire a log notification that a worker booted or send something to statsd.
|
109
112
|
This can be called multiple times to add hooks.
|
110
113
|
|
111
|
-
If you're preloading your application and using ActiveRecord, it's
|
114
|
+
If you're preloading your application and using ActiveRecord, it's recommended that you setup your connection pool here:
|
112
115
|
|
113
116
|
# config/puma.rb
|
114
117
|
on_worker_boot do
|
@@ -127,7 +130,7 @@ On top of that, you can specify a block in your configuration file that will be
|
|
127
130
|
This code can be used to clean up before forking to clients, allowing
|
128
131
|
you to do some Puma-specific things that you don't want to embed in your application.
|
129
132
|
|
130
|
-
If you're preloading your application and using ActiveRecord, it's
|
133
|
+
If you're preloading your application and using ActiveRecord, it's recommended that you close any connections to the database here to prevent connection leakage:
|
131
134
|
|
132
135
|
# config/puma.rb
|
133
136
|
before_fork do
|
@@ -136,7 +139,7 @@ If you're preloading your application and using ActiveRecord, it's recommend you
|
|
136
139
|
|
137
140
|
This rule applies to any connections to external services (Redis, databases, memcache, ...) that might be started automatically by the framework.
|
138
141
|
|
139
|
-
When you use preload_app, your new code goes
|
142
|
+
When you use preload_app, all of your new code goes into the master process, and is then copied into the workers (meaning it’s only compatible with cluster mode). General rule is to use preload_app when your workers die often and need fast starts. If you don’t have many workers, you probably should not use preload_app.
|
140
143
|
|
141
144
|
Note that preload_app can’t be used with phased restart, since phased restart kills and restarts workers one-by-one, and preload_app is all about copying the code of master into the workers.
|
142
145
|
|
@@ -174,7 +177,7 @@ Need a bit of security? Use SSL sockets!
|
|
174
177
|
|
175
178
|
### Control/Status Server
|
176
179
|
|
177
|
-
Puma comes with a builtin status/control app that can be used query and control Puma itself. Here is an example of starting Puma with the control server:
|
180
|
+
Puma comes with a builtin status/control app that can be used to query and control Puma itself. Here is an example of starting Puma with the control server:
|
178
181
|
|
179
182
|
$ puma --control tcp://127.0.0.1:9293 --control-token foo
|
180
183
|
|
@@ -209,26 +212,35 @@ If the new process is unable to load, it will simply exit. You should therefore
|
|
209
212
|
|
210
213
|
### Normal vs Hot vs Phased Restart
|
211
214
|
|
212
|
-
A hot restart means that no requests while deploying your new code
|
215
|
+
A hot restart means that no requests will be lost while deploying your new code, since the server socket is kept open between restarts.
|
213
216
|
|
214
217
|
But beware, hot restart does not mean that the incoming requests won’t hang for multiple seconds while your new code has not fully deployed. If you need a zero downtime and zero hanging requests deploy, you must use phased restart.
|
215
218
|
|
216
|
-
When you run pumactl phased-restart, Puma kills workers one-by-one, meaning that at least another worker is still available to serve requests, which lead
|
219
|
+
When you run pumactl phased-restart, Puma kills workers one-by-one, meaning that at least another worker is still available to serve requests, which lead to zero hanging requests (yay!).
|
217
220
|
|
218
221
|
But again beware, upgrading an application sometimes involves upgrading the database schema. With phased restart, there may be a moment during the deployment where processes belonging to the previous version and processes belonging to the new version both exist at the same time. Any database schema upgrades you perform must therefore be backwards-compatible with the old application version.
|
219
222
|
|
220
|
-
|
223
|
+
If you perform a lot of database migrations, you probably should not use phased restart and use a normal/hot restart instead (pumactl restart). That way, no code is shared while deploying (in that case, preload_app might help for quicker deployment, see below).
|
221
224
|
|
225
|
+
### Release Directory
|
226
|
+
|
227
|
+
If you symlink releases into a common working directory (i.e., `/current` from Capistrano), Puma won't pick up your new changes when running phased restarts without additional configuration. You should set your working directory within Puma's config to specify the directory it should use. This is a change from earlier versions of Puma (< 2.15) that would infer the directory for you.
|
228
|
+
|
229
|
+
```ruby
|
230
|
+
# config/puma.rb
|
231
|
+
|
232
|
+
directory '/var/www/current'
|
233
|
+
```
|
222
234
|
|
223
235
|
### Cleanup Code
|
224
236
|
|
225
237
|
Puma isn't able to understand all the resources that your app may use, so it provides a hook in the configuration file you pass to `-C` called `on_restart`. The block passed to `on_restart` will be called, unsurprisingly, just before Puma restarts itself.
|
226
238
|
|
227
|
-
You should place code to close global log files, redis connections, etc in this block so that their file descriptors don't leak into the restarted process. Failure to do so will result in slowly running out of descriptors and eventually obscure crashes as the server is
|
239
|
+
You should place code to close global log files, redis connections, etc in this block so that their file descriptors don't leak into the restarted process. Failure to do so will result in slowly running out of descriptors and eventually obscure crashes as the server is restarted many times.
|
228
240
|
|
229
241
|
### Platform Constraints
|
230
242
|
|
231
|
-
Because of various platforms not being implement certain things, the following differences occur when Puma is used on different platforms:
|
243
|
+
Because of various platforms not being able to implement certain things, the following differences occur when Puma is used on different platforms:
|
232
244
|
|
233
245
|
* **JRuby**, **Windows**: server sockets are not seamless on restart, they must be closed and reopened. These platforms have no way to pass descriptors into a new process that is exposed to ruby
|
234
246
|
* **JRuby**, **Windows**: cluster mode is not supported due to a lack of fork(2)
|
@@ -240,7 +252,7 @@ Because of various platforms not being implement certain things, the following d
|
|
240
252
|
|
241
253
|
## Managing multiple Pumas / init.d / upstart scripts
|
242
254
|
|
243
|
-
If you want an easy way to manage multiple scripts at once check [tools/jungle](https://github.com/puma/puma/tree/master/tools/jungle) for init.d and upstart scripts.
|
255
|
+
If you want an easy way to manage multiple scripts at once, check [tools/jungle](https://github.com/puma/puma/tree/master/tools/jungle) for init.d and upstart scripts.
|
244
256
|
|
245
257
|
## Capistrano deployment
|
246
258
|
|
@@ -281,4 +293,4 @@ $ bundle exec rake
|
|
281
293
|
|
282
294
|
## License
|
283
295
|
|
284
|
-
Puma is copyright 2014 Evan Phoenix and contributors. It is licensed under the BSD 3-Clause license. See the
|
296
|
+
Puma is copyright 2014 Evan Phoenix and contributors. It is licensed under the BSD 3-Clause license. See the included LICENSE file for details.
|
@@ -7,8 +7,8 @@ public class Http11Parser {
|
|
7
7
|
/** Machine **/
|
8
8
|
|
9
9
|
%%{
|
10
|
-
|
11
|
-
machine
|
10
|
+
|
11
|
+
machine puma_parser;
|
12
12
|
|
13
13
|
action mark {parser.mark = fpc; }
|
14
14
|
|
@@ -60,7 +60,7 @@ public class Http11Parser {
|
|
60
60
|
fbreak;
|
61
61
|
}
|
62
62
|
|
63
|
-
include
|
63
|
+
include puma_parser_common "http11_parser_common.rl";
|
64
64
|
|
65
65
|
}%%
|
66
66
|
|
@@ -152,10 +152,10 @@ public class Http11Parser {
|
|
152
152
|
}
|
153
153
|
|
154
154
|
public boolean has_error() {
|
155
|
-
return parser.cs ==
|
155
|
+
return parser.cs == puma_parser_error;
|
156
156
|
}
|
157
157
|
|
158
158
|
public boolean is_finished() {
|
159
|
-
return parser.cs ==
|
159
|
+
return parser.cs == puma_parser_first_final;
|
160
160
|
}
|
161
161
|
}
|
data/ext/puma_http11/io_buffer.c
CHANGED
@@ -116,7 +116,7 @@ static VALUE buf_to_str(VALUE self) {
|
|
116
116
|
struct buf_int* b;
|
117
117
|
Data_Get_Struct(self, struct buf_int, b);
|
118
118
|
|
119
|
-
return rb_str_new(b->top, b->cur - b->top);
|
119
|
+
return rb_str_new((const char*)(b->top), b->cur - b->top);
|
120
120
|
}
|
121
121
|
|
122
122
|
static VALUE buf_used(VALUE self) {
|
data/ext/puma_http11/mini_ssl.c
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
#define RSTRING_NOT_MODIFIED 1
|
2
2
|
|
3
3
|
#include <ruby.h>
|
4
|
+
#include <ruby/version.h>
|
5
|
+
|
6
|
+
#if RUBY_API_VERSION_MAJOR == 1
|
4
7
|
#include <rubyio.h>
|
8
|
+
#else
|
9
|
+
#include <ruby/io.h>
|
10
|
+
#endif
|
5
11
|
|
6
12
|
#ifdef HAVE_OPENSSL_BIO_H
|
7
13
|
|
@@ -347,7 +353,7 @@ VALUE engine_peercert(VALUE self) {
|
|
347
353
|
}
|
348
354
|
}
|
349
355
|
|
350
|
-
rb_cert_buf = rb_str_new(buf, bytes);
|
356
|
+
rb_cert_buf = rb_str_new((const char*)(buf), bytes);
|
351
357
|
if(!cert_buf) {
|
352
358
|
OPENSSL_free(buf);
|
353
359
|
}
|
@@ -15,7 +15,7 @@ public class Http11Parser {
|
|
15
15
|
/** Data **/
|
16
16
|
|
17
17
|
// line 18 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
|
18
|
-
private static byte[]
|
18
|
+
private static byte[] init__puma_parser_actions_0()
|
19
19
|
{
|
20
20
|
return new byte [] {
|
21
21
|
0, 1, 0, 1, 2, 1, 3, 1, 4, 1, 5, 1,
|
@@ -25,10 +25,10 @@ private static byte[] init__http_parser_actions_0()
|
|
25
25
|
};
|
26
26
|
}
|
27
27
|
|
28
|
-
private static final byte
|
28
|
+
private static final byte _puma_parser_actions[] = init__puma_parser_actions_0();
|
29
29
|
|
30
30
|
|
31
|
-
private static short[]
|
31
|
+
private static short[] init__puma_parser_key_offsets_0()
|
32
32
|
{
|
33
33
|
return new short [] {
|
34
34
|
0, 0, 8, 17, 27, 29, 30, 31, 32, 33, 34, 36,
|
@@ -39,10 +39,10 @@ private static short[] init__http_parser_key_offsets_0()
|
|
39
39
|
};
|
40
40
|
}
|
41
41
|
|
42
|
-
private static final short
|
42
|
+
private static final short _puma_parser_key_offsets[] = init__puma_parser_key_offsets_0();
|
43
43
|
|
44
44
|
|
45
|
-
private static char[]
|
45
|
+
private static char[] init__puma_parser_trans_keys_0()
|
46
46
|
{
|
47
47
|
return new char [] {
|
48
48
|
36, 95, 45, 46, 48, 57, 65, 90, 32, 36, 95, 45,
|
@@ -80,10 +80,10 @@ private static char[] init__http_parser_trans_keys_0()
|
|
80
80
|
};
|
81
81
|
}
|
82
82
|
|
83
|
-
private static final char
|
83
|
+
private static final char _puma_parser_trans_keys[] = init__puma_parser_trans_keys_0();
|
84
84
|
|
85
85
|
|
86
|
-
private static byte[]
|
86
|
+
private static byte[] init__puma_parser_single_lengths_0()
|
87
87
|
{
|
88
88
|
return new byte [] {
|
89
89
|
0, 2, 3, 4, 2, 1, 1, 1, 1, 1, 0, 1,
|
@@ -94,10 +94,10 @@ private static byte[] init__http_parser_single_lengths_0()
|
|
94
94
|
};
|
95
95
|
}
|
96
96
|
|
97
|
-
private static final byte
|
97
|
+
private static final byte _puma_parser_single_lengths[] = init__puma_parser_single_lengths_0();
|
98
98
|
|
99
99
|
|
100
|
-
private static byte[]
|
100
|
+
private static byte[] init__puma_parser_range_lengths_0()
|
101
101
|
{
|
102
102
|
return new byte [] {
|
103
103
|
0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 1, 1,
|
@@ -108,10 +108,10 @@ private static byte[] init__http_parser_range_lengths_0()
|
|
108
108
|
};
|
109
109
|
}
|
110
110
|
|
111
|
-
private static final byte
|
111
|
+
private static final byte _puma_parser_range_lengths[] = init__puma_parser_range_lengths_0();
|
112
112
|
|
113
113
|
|
114
|
-
private static short[]
|
114
|
+
private static short[] init__puma_parser_index_offsets_0()
|
115
115
|
{
|
116
116
|
return new short [] {
|
117
117
|
0, 0, 6, 13, 21, 24, 26, 28, 30, 32, 34, 36,
|
@@ -122,10 +122,10 @@ private static short[] init__http_parser_index_offsets_0()
|
|
122
122
|
};
|
123
123
|
}
|
124
124
|
|
125
|
-
private static final short
|
125
|
+
private static final short _puma_parser_index_offsets[] = init__puma_parser_index_offsets_0();
|
126
126
|
|
127
127
|
|
128
|
-
private static byte[]
|
128
|
+
private static byte[] init__puma_parser_indicies_0()
|
129
129
|
{
|
130
130
|
return new byte [] {
|
131
131
|
0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3,
|
@@ -158,10 +158,10 @@ private static byte[] init__http_parser_indicies_0()
|
|
158
158
|
};
|
159
159
|
}
|
160
160
|
|
161
|
-
private static final byte
|
161
|
+
private static final byte _puma_parser_indicies[] = init__puma_parser_indicies_0();
|
162
162
|
|
163
163
|
|
164
|
-
private static byte[]
|
164
|
+
private static byte[] init__puma_parser_trans_targs_0()
|
165
165
|
{
|
166
166
|
return new byte [] {
|
167
167
|
2, 0, 3, 38, 4, 24, 28, 25, 5, 20, 6, 7,
|
@@ -174,10 +174,10 @@ private static byte[] init__http_parser_trans_targs_0()
|
|
174
174
|
};
|
175
175
|
}
|
176
176
|
|
177
|
-
private static final byte
|
177
|
+
private static final byte _puma_parser_trans_targs[] = init__puma_parser_trans_targs_0();
|
178
178
|
|
179
179
|
|
180
|
-
private static byte[]
|
180
|
+
private static byte[] init__puma_parser_trans_actions_0()
|
181
181
|
{
|
182
182
|
return new byte [] {
|
183
183
|
1, 0, 11, 0, 1, 1, 1, 1, 13, 13, 1, 0,
|
@@ -190,14 +190,14 @@ private static byte[] init__http_parser_trans_actions_0()
|
|
190
190
|
};
|
191
191
|
}
|
192
192
|
|
193
|
-
private static final byte
|
193
|
+
private static final byte _puma_parser_trans_actions[] = init__puma_parser_trans_actions_0();
|
194
194
|
|
195
195
|
|
196
|
-
static final int
|
197
|
-
static final int
|
198
|
-
static final int
|
196
|
+
static final int puma_parser_start = 1;
|
197
|
+
static final int puma_parser_first_final = 57;
|
198
|
+
static final int puma_parser_error = 0;
|
199
199
|
|
200
|
-
static final int
|
200
|
+
static final int puma_parser_en_main = 1;
|
201
201
|
|
202
202
|
|
203
203
|
// line 69 "ext/puma_http11/http11_parser.java.rl"
|
@@ -238,7 +238,7 @@ static final int http_parser_en_main = 1;
|
|
238
238
|
|
239
239
|
// line 240 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
|
240
240
|
{
|
241
|
-
cs =
|
241
|
+
cs = puma_parser_start;
|
242
242
|
}
|
243
243
|
|
244
244
|
// line 104 "ext/puma_http11/http11_parser.java.rl"
|
@@ -290,9 +290,9 @@ static final int http_parser_en_main = 1;
|
|
290
290
|
}
|
291
291
|
case 1:
|
292
292
|
_match: do {
|
293
|
-
_keys =
|
294
|
-
_trans =
|
295
|
-
_klen =
|
293
|
+
_keys = _puma_parser_key_offsets[cs];
|
294
|
+
_trans = _puma_parser_index_offsets[cs];
|
295
|
+
_klen = _puma_parser_single_lengths[cs];
|
296
296
|
if ( _klen > 0 ) {
|
297
297
|
int _lower = _keys;
|
298
298
|
int _mid;
|
@@ -302,9 +302,9 @@ case 1:
|
|
302
302
|
break;
|
303
303
|
|
304
304
|
_mid = _lower + ((_upper-_lower) >> 1);
|
305
|
-
if ( data[p] <
|
305
|
+
if ( data[p] < _puma_parser_trans_keys[_mid] )
|
306
306
|
_upper = _mid - 1;
|
307
|
-
else if ( data[p] >
|
307
|
+
else if ( data[p] > _puma_parser_trans_keys[_mid] )
|
308
308
|
_lower = _mid + 1;
|
309
309
|
else {
|
310
310
|
_trans += (_mid - _keys);
|
@@ -315,7 +315,7 @@ case 1:
|
|
315
315
|
_trans += _klen;
|
316
316
|
}
|
317
317
|
|
318
|
-
_klen =
|
318
|
+
_klen = _puma_parser_range_lengths[cs];
|
319
319
|
if ( _klen > 0 ) {
|
320
320
|
int _lower = _keys;
|
321
321
|
int _mid;
|
@@ -325,9 +325,9 @@ case 1:
|
|
325
325
|
break;
|
326
326
|
|
327
327
|
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
328
|
-
if ( data[p] <
|
328
|
+
if ( data[p] < _puma_parser_trans_keys[_mid] )
|
329
329
|
_upper = _mid - 2;
|
330
|
-
else if ( data[p] >
|
330
|
+
else if ( data[p] > _puma_parser_trans_keys[_mid+1] )
|
331
331
|
_lower = _mid + 2;
|
332
332
|
else {
|
333
333
|
_trans += ((_mid - _keys)>>1);
|
@@ -338,15 +338,15 @@ case 1:
|
|
338
338
|
}
|
339
339
|
} while (false);
|
340
340
|
|
341
|
-
_trans =
|
342
|
-
cs =
|
341
|
+
_trans = _puma_parser_indicies[_trans];
|
342
|
+
cs = _puma_parser_trans_targs[_trans];
|
343
343
|
|
344
|
-
if (
|
345
|
-
_acts =
|
346
|
-
_nacts = (int)
|
344
|
+
if ( _puma_parser_trans_actions[_trans] != 0 ) {
|
345
|
+
_acts = _puma_parser_trans_actions[_trans];
|
346
|
+
_nacts = (int) _puma_parser_actions[_acts++];
|
347
347
|
while ( _nacts-- > 0 )
|
348
348
|
{
|
349
|
-
switch (
|
349
|
+
switch ( _puma_parser_actions[_acts++] )
|
350
350
|
{
|
351
351
|
case 0:
|
352
352
|
// line 13 "ext/puma_http11/http11_parser.java.rl"
|
@@ -479,10 +479,10 @@ case 5:
|
|
479
479
|
}
|
480
480
|
|
481
481
|
public boolean has_error() {
|
482
|
-
return parser.cs ==
|
482
|
+
return parser.cs == puma_parser_error;
|
483
483
|
}
|
484
484
|
|
485
485
|
public boolean is_finished() {
|
486
|
-
return parser.cs ==
|
486
|
+
return parser.cs == puma_parser_first_final;
|
487
487
|
}
|
488
488
|
}
|