tiny-fast-gem 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/puma-8.0.2/History.md +3334 -0
- data/puma-8.0.2/LICENSE +29 -0
- data/puma-8.0.2/README.md +484 -0
- data/puma-8.0.2/bin/puma +10 -0
- data/puma-8.0.2/bin/puma-wild +25 -0
- data/puma-8.0.2/bin/pumactl +12 -0
- data/puma-8.0.2/docs/5.0-Upgrade.md +98 -0
- data/puma-8.0.2/docs/6.0-Upgrade.md +56 -0
- data/puma-8.0.2/docs/7.0-Upgrade.md +52 -0
- data/puma-8.0.2/docs/8.0-Upgrade.md +100 -0
- data/puma-8.0.2/docs/architecture.md +74 -0
- data/puma-8.0.2/docs/compile_options.md +55 -0
- data/puma-8.0.2/docs/deployment.md +137 -0
- data/puma-8.0.2/docs/fork_worker.md +41 -0
- data/puma-8.0.2/docs/grpc.md +62 -0
- data/puma-8.0.2/docs/images/favicon.svg +1 -0
- data/puma-8.0.2/docs/images/puma-connection-flow-no-reactor.png +0 -0
- data/puma-8.0.2/docs/images/puma-connection-flow.png +0 -0
- data/puma-8.0.2/docs/images/puma-general-arch.png +0 -0
- data/puma-8.0.2/docs/images/running-puma.svg +1 -0
- data/puma-8.0.2/docs/images/standard-logo.svg +1 -0
- data/puma-8.0.2/docs/java_options.md +54 -0
- data/puma-8.0.2/docs/jungle/README.md +9 -0
- data/puma-8.0.2/docs/jungle/rc.d/README.md +74 -0
- data/puma-8.0.2/docs/jungle/rc.d/puma +61 -0
- data/puma-8.0.2/docs/jungle/rc.d/puma.conf +10 -0
- data/puma-8.0.2/docs/kubernetes.md +73 -0
- data/puma-8.0.2/docs/nginx.md +80 -0
- data/puma-8.0.2/docs/plugins.md +42 -0
- data/puma-8.0.2/docs/rails_dev_mode.md +28 -0
- data/puma-8.0.2/docs/restart.md +65 -0
- data/puma-8.0.2/docs/signals.md +98 -0
- data/puma-8.0.2/docs/stats.md +148 -0
- data/puma-8.0.2/docs/systemd.md +253 -0
- data/puma-8.0.2/docs/testing_benchmarks_local_files.md +150 -0
- data/puma-8.0.2/docs/testing_test_rackup_ci_files.md +36 -0
- data/puma-8.0.2/ext/puma_http11/PumaHttp11Service.java +17 -0
- data/puma-8.0.2/ext/puma_http11/extconf.rb +65 -0
- data/puma-8.0.2/ext/puma_http11/http11_parser.c +1057 -0
- data/puma-8.0.2/ext/puma_http11/http11_parser.h +65 -0
- data/puma-8.0.2/ext/puma_http11/http11_parser.java.rl +131 -0
- data/puma-8.0.2/ext/puma_http11/http11_parser.rl +149 -0
- data/puma-8.0.2/ext/puma_http11/http11_parser_common.rl +54 -0
- data/puma-8.0.2/ext/puma_http11/mini_ssl.c +852 -0
- data/puma-8.0.2/ext/puma_http11/no_ssl/PumaHttp11Service.java +15 -0
- data/puma-8.0.2/ext/puma_http11/org/jruby/puma/EnvKey.java +241 -0
- data/puma-8.0.2/ext/puma_http11/org/jruby/puma/Http11.java +321 -0
- data/puma-8.0.2/ext/puma_http11/org/jruby/puma/Http11Parser.java +441 -0
- data/puma-8.0.2/ext/puma_http11/org/jruby/puma/MiniSSL.java +509 -0
- data/puma-8.0.2/ext/puma_http11/puma_http11.c +499 -0
- data/puma-8.0.2/lib/puma/app/status.rb +104 -0
- data/puma-8.0.2/lib/puma/binder.rb +511 -0
- data/puma-8.0.2/lib/puma/cli.rb +245 -0
- data/puma-8.0.2/lib/puma/client.rb +756 -0
- data/puma-8.0.2/lib/puma/client_env.rb +171 -0
- data/puma-8.0.2/lib/puma/cluster/worker.rb +183 -0
- data/puma-8.0.2/lib/puma/cluster/worker_handle.rb +127 -0
- data/puma-8.0.2/lib/puma/cluster.rb +634 -0
- data/puma-8.0.2/lib/puma/cluster_accept_loop_delay.rb +91 -0
- data/puma-8.0.2/lib/puma/commonlogger.rb +115 -0
- data/puma-8.0.2/lib/puma/configuration.rb +522 -0
- data/puma-8.0.2/lib/puma/const.rb +308 -0
- data/puma-8.0.2/lib/puma/control_cli.rb +320 -0
- data/puma-8.0.2/lib/puma/detect.rb +58 -0
- data/puma-8.0.2/lib/puma/dsl.rb +1562 -0
- data/puma-8.0.2/lib/puma/error_logger.rb +115 -0
- data/puma-8.0.2/lib/puma/events.rb +72 -0
- data/puma-8.0.2/lib/puma/io_buffer.rb +50 -0
- data/puma-8.0.2/lib/puma/jruby_restart.rb +11 -0
- data/puma-8.0.2/lib/puma/json_serialization.rb +96 -0
- data/puma-8.0.2/lib/puma/launcher/bundle_pruner.rb +102 -0
- data/puma-8.0.2/lib/puma/launcher.rb +501 -0
- data/puma-8.0.2/lib/puma/log_writer.rb +153 -0
- data/puma-8.0.2/lib/puma/minissl/context_builder.rb +96 -0
- data/puma-8.0.2/lib/puma/minissl.rb +458 -0
- data/puma-8.0.2/lib/puma/null_io.rb +101 -0
- data/puma-8.0.2/lib/puma/plugin/systemd.rb +90 -0
- data/puma-8.0.2/lib/puma/plugin/tmp_restart.rb +36 -0
- data/puma-8.0.2/lib/puma/plugin.rb +111 -0
- data/puma-8.0.2/lib/puma/rack/builder.rb +297 -0
- data/puma-8.0.2/lib/puma/rack/urlmap.rb +93 -0
- data/puma-8.0.2/lib/puma/rack_default.rb +24 -0
- data/puma-8.0.2/lib/puma/reactor.rb +131 -0
- data/puma-8.0.2/lib/puma/response.rb +532 -0
- data/puma-8.0.2/lib/puma/runner.rb +211 -0
- data/puma-8.0.2/lib/puma/sd_notify.rb +146 -0
- data/puma-8.0.2/lib/puma/server.rb +773 -0
- data/puma-8.0.2/lib/puma/server_plugin_control.rb +32 -0
- data/puma-8.0.2/lib/puma/single.rb +72 -0
- data/puma-8.0.2/lib/puma/state_file.rb +69 -0
- data/puma-8.0.2/lib/puma/thread_pool.rb +517 -0
- data/puma-8.0.2/lib/puma/util.rb +134 -0
- data/puma-8.0.2/lib/puma.rb +88 -0
- data/puma-8.0.2/lib/rack/handler/puma.rb +144 -0
- data/puma-8.0.2/tools/Dockerfile +26 -0
- data/puma-8.0.2/tools/trickletest.rb +44 -0
- data/tiny-fast-gem.gemspec +12 -0
- metadata +138 -0
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
|
|
2
|
+
// line 1 "ext/puma_http11/http11_parser.java.rl"
|
|
3
|
+
package org.jruby.puma;
|
|
4
|
+
|
|
5
|
+
import org.jruby.Ruby;
|
|
6
|
+
import org.jruby.RubyHash;
|
|
7
|
+
import org.jruby.RubyString;
|
|
8
|
+
import org.jruby.util.ByteList;
|
|
9
|
+
|
|
10
|
+
public class Http11Parser {
|
|
11
|
+
|
|
12
|
+
/** Machine **/
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
// line 59 "ext/puma_http11/http11_parser.java.rl"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/** Data **/
|
|
19
|
+
|
|
20
|
+
// line 21 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
|
|
21
|
+
private static byte[] init__puma_parser_actions_0()
|
|
22
|
+
{
|
|
23
|
+
return new byte [] {
|
|
24
|
+
0, 1, 0, 1, 2, 1, 3, 1, 4, 1, 5, 1,
|
|
25
|
+
6, 1, 7, 1, 8, 1, 9, 1, 11, 1, 12, 1,
|
|
26
|
+
13, 2, 0, 8, 2, 1, 2, 2, 4, 5, 2, 10,
|
|
27
|
+
7, 2, 12, 7, 3, 9, 10, 7
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private static final byte _puma_parser_actions[] = init__puma_parser_actions_0();
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
private static short[] init__puma_parser_key_offsets_0()
|
|
35
|
+
{
|
|
36
|
+
return new short [] {
|
|
37
|
+
0, 0, 8, 17, 27, 29, 30, 31, 32, 33, 34, 36,
|
|
38
|
+
39, 41, 44, 45, 61, 62, 78, 85, 91, 99, 107, 117,
|
|
39
|
+
125, 134, 142, 150, 159, 168, 177, 186, 195, 204, 213, 222,
|
|
40
|
+
231, 240, 249, 258, 267, 276, 285, 294, 303, 312, 313
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private static final short _puma_parser_key_offsets[] = init__puma_parser_key_offsets_0();
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
private static char[] init__puma_parser_trans_keys_0()
|
|
48
|
+
{
|
|
49
|
+
return new char [] {
|
|
50
|
+
36, 95, 45, 46, 48, 57, 65, 90, 32, 36, 95, 45,
|
|
51
|
+
46, 48, 57, 65, 90, 42, 43, 47, 58, 45, 57, 65,
|
|
52
|
+
90, 97, 122, 32, 35, 72, 84, 84, 80, 47, 48, 57,
|
|
53
|
+
46, 48, 57, 48, 57, 13, 48, 57, 10, 13, 33, 124,
|
|
54
|
+
126, 35, 39, 42, 43, 45, 46, 48, 57, 65, 90, 94,
|
|
55
|
+
122, 10, 33, 58, 124, 126, 35, 39, 42, 43, 45, 46,
|
|
56
|
+
48, 57, 65, 90, 94, 122, 13, 32, 127, 0, 8, 10,
|
|
57
|
+
31, 13, 127, 0, 8, 10, 31, 32, 60, 62, 127, 0,
|
|
58
|
+
31, 34, 35, 32, 60, 62, 127, 0, 31, 34, 35, 43,
|
|
59
|
+
58, 45, 46, 48, 57, 65, 90, 97, 122, 32, 34, 35,
|
|
60
|
+
60, 62, 127, 0, 31, 32, 34, 35, 60, 62, 63, 127,
|
|
61
|
+
0, 31, 32, 34, 35, 60, 62, 127, 0, 31, 32, 34,
|
|
62
|
+
35, 60, 62, 127, 0, 31, 32, 36, 95, 45, 46, 48,
|
|
63
|
+
57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65, 90,
|
|
64
|
+
32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36, 95,
|
|
65
|
+
45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46, 48,
|
|
66
|
+
57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65, 90,
|
|
67
|
+
32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36, 95,
|
|
68
|
+
45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46, 48,
|
|
69
|
+
57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65, 90,
|
|
70
|
+
32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36, 95,
|
|
71
|
+
45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46, 48,
|
|
72
|
+
57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65, 90,
|
|
73
|
+
32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36, 95,
|
|
74
|
+
45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46, 48,
|
|
75
|
+
57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65, 90,
|
|
76
|
+
32, 0
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private static final char _puma_parser_trans_keys[] = init__puma_parser_trans_keys_0();
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
private static byte[] init__puma_parser_single_lengths_0()
|
|
84
|
+
{
|
|
85
|
+
return new byte [] {
|
|
86
|
+
0, 2, 3, 4, 2, 1, 1, 1, 1, 1, 0, 1,
|
|
87
|
+
0, 1, 1, 4, 1, 4, 3, 2, 4, 4, 2, 6,
|
|
88
|
+
7, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
89
|
+
3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 0
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private static final byte _puma_parser_single_lengths[] = init__puma_parser_single_lengths_0();
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
private static byte[] init__puma_parser_range_lengths_0()
|
|
97
|
+
{
|
|
98
|
+
return new byte [] {
|
|
99
|
+
0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 1, 1,
|
|
100
|
+
1, 1, 0, 6, 0, 6, 2, 2, 2, 2, 4, 1,
|
|
101
|
+
1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
|
102
|
+
3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
private static final byte _puma_parser_range_lengths[] = init__puma_parser_range_lengths_0();
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
private static short[] init__puma_parser_index_offsets_0()
|
|
110
|
+
{
|
|
111
|
+
return new short [] {
|
|
112
|
+
0, 0, 6, 13, 21, 24, 26, 28, 30, 32, 34, 36,
|
|
113
|
+
39, 41, 44, 46, 57, 59, 70, 76, 81, 88, 95, 102,
|
|
114
|
+
110, 119, 127, 135, 142, 149, 156, 163, 170, 177, 184, 191,
|
|
115
|
+
198, 205, 212, 219, 226, 233, 240, 247, 254, 261, 263
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
private static final short _puma_parser_index_offsets[] = init__puma_parser_index_offsets_0();
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
private static byte[] init__puma_parser_indicies_0()
|
|
123
|
+
{
|
|
124
|
+
return new byte [] {
|
|
125
|
+
0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3,
|
|
126
|
+
1, 4, 5, 6, 7, 5, 5, 5, 1, 8, 9, 1,
|
|
127
|
+
10, 1, 11, 1, 12, 1, 13, 1, 14, 1, 15, 1,
|
|
128
|
+
16, 15, 1, 17, 1, 18, 17, 1, 19, 1, 20, 21,
|
|
129
|
+
21, 21, 21, 21, 21, 21, 21, 21, 1, 22, 1, 23,
|
|
130
|
+
24, 23, 23, 23, 23, 23, 23, 23, 23, 1, 26, 27,
|
|
131
|
+
1, 1, 1, 25, 29, 1, 1, 1, 28, 30, 1, 1,
|
|
132
|
+
1, 1, 1, 31, 32, 1, 1, 1, 1, 1, 33, 34,
|
|
133
|
+
35, 34, 34, 34, 34, 1, 8, 1, 9, 1, 1, 1,
|
|
134
|
+
1, 35, 36, 1, 38, 1, 1, 39, 1, 1, 37, 40,
|
|
135
|
+
1, 42, 1, 1, 1, 1, 41, 43, 1, 45, 1, 1,
|
|
136
|
+
1, 1, 44, 2, 46, 46, 46, 46, 46, 1, 2, 47,
|
|
137
|
+
47, 47, 47, 47, 1, 2, 48, 48, 48, 48, 48, 1,
|
|
138
|
+
2, 49, 49, 49, 49, 49, 1, 2, 50, 50, 50, 50,
|
|
139
|
+
50, 1, 2, 51, 51, 51, 51, 51, 1, 2, 52, 52,
|
|
140
|
+
52, 52, 52, 1, 2, 53, 53, 53, 53, 53, 1, 2,
|
|
141
|
+
54, 54, 54, 54, 54, 1, 2, 55, 55, 55, 55, 55,
|
|
142
|
+
1, 2, 56, 56, 56, 56, 56, 1, 2, 57, 57, 57,
|
|
143
|
+
57, 57, 1, 2, 58, 58, 58, 58, 58, 1, 2, 59,
|
|
144
|
+
59, 59, 59, 59, 1, 2, 60, 60, 60, 60, 60, 1,
|
|
145
|
+
2, 61, 61, 61, 61, 61, 1, 2, 62, 62, 62, 62,
|
|
146
|
+
62, 1, 2, 63, 63, 63, 63, 63, 1, 2, 1, 1,
|
|
147
|
+
0
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
private static final byte _puma_parser_indicies[] = init__puma_parser_indicies_0();
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
private static byte[] init__puma_parser_trans_targs_0()
|
|
155
|
+
{
|
|
156
|
+
return new byte [] {
|
|
157
|
+
2, 0, 3, 27, 4, 22, 24, 23, 5, 20, 6, 7,
|
|
158
|
+
8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 46, 17,
|
|
159
|
+
18, 19, 14, 18, 19, 14, 5, 21, 5, 21, 22, 23,
|
|
160
|
+
5, 24, 20, 25, 5, 26, 20, 5, 26, 20, 28, 29,
|
|
161
|
+
30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
|
|
162
|
+
42, 43, 44, 45
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
private static final byte _puma_parser_trans_targs[] = init__puma_parser_trans_targs_0();
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
private static byte[] init__puma_parser_trans_actions_0()
|
|
170
|
+
{
|
|
171
|
+
return new byte [] {
|
|
172
|
+
1, 0, 11, 0, 1, 1, 1, 1, 13, 13, 1, 0,
|
|
173
|
+
0, 0, 0, 0, 0, 0, 19, 0, 0, 28, 23, 3,
|
|
174
|
+
5, 7, 31, 7, 0, 9, 25, 1, 15, 0, 0, 0,
|
|
175
|
+
37, 0, 37, 21, 40, 17, 40, 34, 0, 34, 0, 0,
|
|
176
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
177
|
+
0, 0, 0, 0
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
private static final byte _puma_parser_trans_actions[] = init__puma_parser_trans_actions_0();
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
static final int puma_parser_start = 1;
|
|
185
|
+
static final int puma_parser_first_final = 46;
|
|
186
|
+
static final int puma_parser_error = 0;
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
// line 63 "ext/puma_http11/http11_parser.java.rl"
|
|
190
|
+
|
|
191
|
+
int cs;
|
|
192
|
+
int body_start;
|
|
193
|
+
int nread;
|
|
194
|
+
int mark;
|
|
195
|
+
int field_start;
|
|
196
|
+
int field_len;
|
|
197
|
+
int query_start;
|
|
198
|
+
|
|
199
|
+
RubyHash data;
|
|
200
|
+
byte[] buffer;
|
|
201
|
+
|
|
202
|
+
public void init() {
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
// line 206 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
|
|
206
|
+
{
|
|
207
|
+
cs = puma_parser_start;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// line 78 "ext/puma_http11/http11_parser.java.rl"
|
|
211
|
+
|
|
212
|
+
body_start = 0;
|
|
213
|
+
mark = 0;
|
|
214
|
+
nread = 0;
|
|
215
|
+
field_len = 0;
|
|
216
|
+
field_start = 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
public int execute(Ruby runtime, Http11 http, ByteList buffer, int off) {
|
|
220
|
+
int p, pe;
|
|
221
|
+
int cs = this.cs;
|
|
222
|
+
int len = buffer.length();
|
|
223
|
+
int beg = buffer.begin();
|
|
224
|
+
RubyString[] envStrings = http.envStrings;
|
|
225
|
+
assert off<=len : "offset past end of buffer";
|
|
226
|
+
|
|
227
|
+
p = beg + off;
|
|
228
|
+
pe = beg + len;
|
|
229
|
+
byte[] data = buffer.unsafeBytes();
|
|
230
|
+
this.buffer = data;
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
// line 234 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
|
|
234
|
+
{
|
|
235
|
+
int _klen;
|
|
236
|
+
int _trans = 0;
|
|
237
|
+
int _acts;
|
|
238
|
+
int _nacts;
|
|
239
|
+
int _keys;
|
|
240
|
+
int _goto_targ = 0;
|
|
241
|
+
|
|
242
|
+
_goto: while (true) {
|
|
243
|
+
switch ( _goto_targ ) {
|
|
244
|
+
case 0:
|
|
245
|
+
if ( p == pe ) {
|
|
246
|
+
_goto_targ = 4;
|
|
247
|
+
continue _goto;
|
|
248
|
+
}
|
|
249
|
+
if ( cs == 0 ) {
|
|
250
|
+
_goto_targ = 5;
|
|
251
|
+
continue _goto;
|
|
252
|
+
}
|
|
253
|
+
case 1:
|
|
254
|
+
_match: do {
|
|
255
|
+
_keys = _puma_parser_key_offsets[cs];
|
|
256
|
+
_trans = _puma_parser_index_offsets[cs];
|
|
257
|
+
_klen = _puma_parser_single_lengths[cs];
|
|
258
|
+
if ( _klen > 0 ) {
|
|
259
|
+
int _lower = _keys;
|
|
260
|
+
int _mid;
|
|
261
|
+
int _upper = _keys + _klen - 1;
|
|
262
|
+
while (true) {
|
|
263
|
+
if ( _upper < _lower )
|
|
264
|
+
break;
|
|
265
|
+
|
|
266
|
+
_mid = _lower + ((_upper-_lower) >> 1);
|
|
267
|
+
if ( data[p] < _puma_parser_trans_keys[_mid] )
|
|
268
|
+
_upper = _mid - 1;
|
|
269
|
+
else if ( data[p] > _puma_parser_trans_keys[_mid] )
|
|
270
|
+
_lower = _mid + 1;
|
|
271
|
+
else {
|
|
272
|
+
_trans += (_mid - _keys);
|
|
273
|
+
break _match;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
_keys += _klen;
|
|
277
|
+
_trans += _klen;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
_klen = _puma_parser_range_lengths[cs];
|
|
281
|
+
if ( _klen > 0 ) {
|
|
282
|
+
int _lower = _keys;
|
|
283
|
+
int _mid;
|
|
284
|
+
int _upper = _keys + (_klen<<1) - 2;
|
|
285
|
+
while (true) {
|
|
286
|
+
if ( _upper < _lower )
|
|
287
|
+
break;
|
|
288
|
+
|
|
289
|
+
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
|
290
|
+
if ( data[p] < _puma_parser_trans_keys[_mid] )
|
|
291
|
+
_upper = _mid - 2;
|
|
292
|
+
else if ( data[p] > _puma_parser_trans_keys[_mid+1] )
|
|
293
|
+
_lower = _mid + 2;
|
|
294
|
+
else {
|
|
295
|
+
_trans += ((_mid - _keys)>>1);
|
|
296
|
+
break _match;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
_trans += _klen;
|
|
300
|
+
}
|
|
301
|
+
} while (false);
|
|
302
|
+
|
|
303
|
+
_trans = _puma_parser_indicies[_trans];
|
|
304
|
+
cs = _puma_parser_trans_targs[_trans];
|
|
305
|
+
|
|
306
|
+
if ( _puma_parser_trans_actions[_trans] != 0 ) {
|
|
307
|
+
_acts = _puma_parser_trans_actions[_trans];
|
|
308
|
+
_nacts = (int) _puma_parser_actions[_acts++];
|
|
309
|
+
while ( _nacts-- > 0 )
|
|
310
|
+
{
|
|
311
|
+
switch ( _puma_parser_actions[_acts++] )
|
|
312
|
+
{
|
|
313
|
+
case 0:
|
|
314
|
+
// line 16 "ext/puma_http11/http11_parser.java.rl"
|
|
315
|
+
{this.mark = p; }
|
|
316
|
+
break;
|
|
317
|
+
case 1:
|
|
318
|
+
// line 18 "ext/puma_http11/http11_parser.java.rl"
|
|
319
|
+
{ this.field_start = p; }
|
|
320
|
+
break;
|
|
321
|
+
case 2:
|
|
322
|
+
// line 19 "ext/puma_http11/http11_parser.java.rl"
|
|
323
|
+
{ /* done lazily as needed */ }
|
|
324
|
+
break;
|
|
325
|
+
case 3:
|
|
326
|
+
// line 20 "ext/puma_http11/http11_parser.java.rl"
|
|
327
|
+
{
|
|
328
|
+
this.field_len = p-this.field_start;
|
|
329
|
+
}
|
|
330
|
+
break;
|
|
331
|
+
case 4:
|
|
332
|
+
// line 24 "ext/puma_http11/http11_parser.java.rl"
|
|
333
|
+
{ this.mark = p; }
|
|
334
|
+
break;
|
|
335
|
+
case 5:
|
|
336
|
+
// line 25 "ext/puma_http11/http11_parser.java.rl"
|
|
337
|
+
{
|
|
338
|
+
Http11.http_field(runtime, envStrings, this, p-this.mark);
|
|
339
|
+
}
|
|
340
|
+
break;
|
|
341
|
+
case 6:
|
|
342
|
+
// line 28 "ext/puma_http11/http11_parser.java.rl"
|
|
343
|
+
{
|
|
344
|
+
Http11.request_method(runtime, envStrings, this, p-this.mark);
|
|
345
|
+
}
|
|
346
|
+
break;
|
|
347
|
+
case 7:
|
|
348
|
+
// line 31 "ext/puma_http11/http11_parser.java.rl"
|
|
349
|
+
{
|
|
350
|
+
Http11.request_uri(runtime, envStrings, this, p-this.mark);
|
|
351
|
+
}
|
|
352
|
+
break;
|
|
353
|
+
case 8:
|
|
354
|
+
// line 34 "ext/puma_http11/http11_parser.java.rl"
|
|
355
|
+
{
|
|
356
|
+
Http11.fragment(runtime, envStrings, this, p-this.mark);
|
|
357
|
+
}
|
|
358
|
+
break;
|
|
359
|
+
case 9:
|
|
360
|
+
// line 38 "ext/puma_http11/http11_parser.java.rl"
|
|
361
|
+
{this.query_start = p; }
|
|
362
|
+
break;
|
|
363
|
+
case 10:
|
|
364
|
+
// line 39 "ext/puma_http11/http11_parser.java.rl"
|
|
365
|
+
{
|
|
366
|
+
Http11.query_string(runtime, envStrings, this, p-this.query_start);
|
|
367
|
+
}
|
|
368
|
+
break;
|
|
369
|
+
case 11:
|
|
370
|
+
// line 43 "ext/puma_http11/http11_parser.java.rl"
|
|
371
|
+
{
|
|
372
|
+
Http11.server_protocol(runtime, envStrings, this, p-this.mark);
|
|
373
|
+
}
|
|
374
|
+
break;
|
|
375
|
+
case 12:
|
|
376
|
+
// line 47 "ext/puma_http11/http11_parser.java.rl"
|
|
377
|
+
{
|
|
378
|
+
Http11.request_path(runtime, envStrings, this, p-this.mark);
|
|
379
|
+
}
|
|
380
|
+
break;
|
|
381
|
+
case 13:
|
|
382
|
+
// line 51 "ext/puma_http11/http11_parser.java.rl"
|
|
383
|
+
{
|
|
384
|
+
this.body_start = p + 1;
|
|
385
|
+
http.header_done(runtime, this, p + 1, pe - p - 1);
|
|
386
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
387
|
+
}
|
|
388
|
+
break;
|
|
389
|
+
// line 390 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
case 2:
|
|
395
|
+
if ( cs == 0 ) {
|
|
396
|
+
_goto_targ = 5;
|
|
397
|
+
continue _goto;
|
|
398
|
+
}
|
|
399
|
+
if ( ++p != pe ) {
|
|
400
|
+
_goto_targ = 1;
|
|
401
|
+
continue _goto;
|
|
402
|
+
}
|
|
403
|
+
case 4:
|
|
404
|
+
case 5:
|
|
405
|
+
}
|
|
406
|
+
break; }
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// line 100 "ext/puma_http11/http11_parser.java.rl"
|
|
410
|
+
|
|
411
|
+
this.cs = cs;
|
|
412
|
+
this.nread += (p - off);
|
|
413
|
+
|
|
414
|
+
assert p <= pe : "buffer overflow after parsing execute";
|
|
415
|
+
assert this.nread <= len : "nread longer than length";
|
|
416
|
+
assert this.body_start <= len : "body starts after buffer end";
|
|
417
|
+
assert this.mark < len : "mark is after buffer end";
|
|
418
|
+
assert this.field_len <= len : "field has length longer than whole buffer";
|
|
419
|
+
assert this.field_start < len : "field starts after buffer end";
|
|
420
|
+
|
|
421
|
+
return this.nread;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
public int finish() {
|
|
425
|
+
if(has_error()) {
|
|
426
|
+
return -1;
|
|
427
|
+
} else if(is_finished()) {
|
|
428
|
+
return 1;
|
|
429
|
+
} else {
|
|
430
|
+
return 0;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
public boolean has_error() {
|
|
435
|
+
return this.cs == puma_parser_error;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
public boolean is_finished() {
|
|
439
|
+
return this.cs == puma_parser_first_final;
|
|
440
|
+
}
|
|
441
|
+
}
|