puma 3.4.0 → 3.5.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/DEPLOYMENT.md +1 -1
- data/History.txt +39 -0
- data/Manifest.txt +0 -1
- data/ext/puma_http11/http11_parser.c +272 -429
- data/ext/puma_http11/http11_parser_common.rl +1 -1
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +63 -78
- data/lib/puma/binder.rb +33 -13
- data/lib/puma/cluster.rb +1 -1
- data/lib/puma/configuration.rb +4 -2
- data/lib/puma/const.rb +2 -2
- data/lib/puma/dsl.rb +9 -2
- data/lib/puma/events.rb +11 -5
- data/lib/puma/reactor.rb +9 -0
- data/lib/puma/server.rb +2 -2
- data/lib/puma/tcp_logger.rb +8 -1
- data/lib/puma/thread_pool.rb +4 -1
- data/tools/jungle/init.d/puma +65 -8
- data/tools/jungle/init.d/run-puma +11 -0
- data/tools/jungle/upstart/puma.conf +1 -1
- metadata +2 -4
- data/docs/config.md +0 -0
@@ -15,7 +15,7 @@
|
|
15
15
|
national = any -- (alpha | digit | reserved | extra | safe | unsafe);
|
16
16
|
unreserved = (alpha | digit | safe | extra | national);
|
17
17
|
escape = ("%" xdigit xdigit);
|
18
|
-
uchar = (unreserved | escape);
|
18
|
+
uchar = (unreserved | escape | "%");
|
19
19
|
pchar = (uchar | ":" | "@" | "&" | "=" | "+");
|
20
20
|
tspecials = ("(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\\" | "\"" | "/" | "[" | "]" | "?" | "=" | "{" | "}" | " " | "\t");
|
21
21
|
|
@@ -32,10 +32,9 @@ 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,
|
35
|
-
39, 41, 44, 45, 61, 62, 78, 80, 81,
|
36
|
-
|
37
|
-
|
38
|
-
307, 316, 325, 334, 343, 352, 361, 370, 379, 380
|
35
|
+
39, 41, 44, 45, 61, 62, 78, 80, 81, 89, 97, 107,
|
36
|
+
115, 125, 134, 142, 150, 159, 168, 177, 186, 195, 204, 213,
|
37
|
+
222, 231, 240, 249, 258, 267, 276, 285, 294, 303, 312, 313
|
39
38
|
};
|
40
39
|
}
|
41
40
|
|
@@ -51,32 +50,27 @@ private static char[] init__puma_parser_trans_keys_0()
|
|
51
50
|
46, 48, 57, 48, 57, 13, 48, 57, 10, 13, 33, 124,
|
52
51
|
126, 35, 39, 42, 43, 45, 46, 48, 57, 65, 90, 94,
|
53
52
|
122, 10, 33, 58, 124, 126, 35, 39, 42, 43, 45, 46,
|
54
|
-
48, 57, 65, 90, 94, 122, 13, 32, 13, 32,
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
35,
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
90, 32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36,
|
76
|
-
95, 45, 46, 48, 57, 65, 90, 32, 36, 95, 45, 46,
|
77
|
-
48, 57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65,
|
78
|
-
90, 32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36,
|
79
|
-
95, 45, 46, 48, 57, 65, 90, 32, 0
|
53
|
+
48, 57, 65, 90, 94, 122, 13, 32, 13, 32, 60, 62,
|
54
|
+
127, 0, 31, 34, 35, 32, 60, 62, 127, 0, 31, 34,
|
55
|
+
35, 43, 58, 45, 46, 48, 57, 65, 90, 97, 122, 32,
|
56
|
+
34, 35, 60, 62, 127, 0, 31, 32, 34, 35, 59, 60,
|
57
|
+
62, 63, 127, 0, 31, 32, 34, 35, 60, 62, 63, 127,
|
58
|
+
0, 31, 32, 34, 35, 60, 62, 127, 0, 31, 32, 34,
|
59
|
+
35, 60, 62, 127, 0, 31, 32, 36, 95, 45, 46, 48,
|
60
|
+
57, 65, 90, 32, 36, 95, 45, 46, 48, 57, 65, 90,
|
61
|
+
32, 36, 95, 45, 46, 48, 57, 65, 90, 32, 36, 95,
|
62
|
+
45, 46, 48, 57, 65, 90, 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, 0
|
80
74
|
};
|
81
75
|
}
|
82
76
|
|
@@ -87,10 +81,9 @@ private static byte[] init__puma_parser_single_lengths_0()
|
|
87
81
|
{
|
88
82
|
return new byte [] {
|
89
83
|
0, 2, 3, 4, 2, 1, 1, 1, 1, 1, 0, 1,
|
90
|
-
0, 1, 1, 4, 1, 4, 2, 1,
|
91
|
-
|
92
|
-
|
93
|
-
3, 3, 3, 3, 3, 3, 3, 3, 1, 0
|
84
|
+
0, 1, 1, 4, 1, 4, 2, 1, 4, 4, 2, 6,
|
85
|
+
8, 7, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3,
|
86
|
+
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 0
|
94
87
|
};
|
95
88
|
}
|
96
89
|
|
@@ -101,10 +94,9 @@ private static byte[] init__puma_parser_range_lengths_0()
|
|
101
94
|
{
|
102
95
|
return new byte [] {
|
103
96
|
0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 1, 1,
|
104
|
-
1, 1, 0, 6, 0, 6, 0, 0, 2, 2,
|
105
|
-
|
106
|
-
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
107
|
-
3, 3, 3, 3, 3, 3, 3, 3, 0, 0
|
97
|
+
1, 1, 0, 6, 0, 6, 0, 0, 2, 2, 4, 1,
|
98
|
+
1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
|
99
|
+
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0
|
108
100
|
};
|
109
101
|
}
|
110
102
|
|
@@ -115,10 +107,9 @@ private static short[] init__puma_parser_index_offsets_0()
|
|
115
107
|
{
|
116
108
|
return new short [] {
|
117
109
|
0, 0, 6, 13, 21, 24, 26, 28, 30, 32, 34, 36,
|
118
|
-
39, 41, 44, 46, 57, 59, 70, 73, 75,
|
119
|
-
|
120
|
-
|
121
|
-
256, 263, 270, 277, 284, 291, 298, 305, 312, 314
|
110
|
+
39, 41, 44, 46, 57, 59, 70, 73, 75, 82, 89, 96,
|
111
|
+
104, 114, 123, 131, 139, 146, 153, 160, 167, 174, 181, 188,
|
112
|
+
195, 202, 209, 216, 223, 230, 237, 244, 251, 258, 265, 267
|
122
113
|
};
|
123
114
|
}
|
124
115
|
|
@@ -134,27 +125,23 @@ private static byte[] init__puma_parser_indicies_0()
|
|
134
125
|
16, 15, 1, 17, 1, 18, 17, 1, 19, 1, 20, 21,
|
135
126
|
21, 21, 21, 21, 21, 21, 21, 21, 1, 22, 1, 23,
|
136
127
|
24, 23, 23, 23, 23, 23, 23, 23, 23, 1, 26, 27,
|
137
|
-
25, 29, 28, 30,
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
1,
|
143
|
-
|
144
|
-
|
145
|
-
53,
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
1, 2, 74, 74, 74, 74, 74, 1, 2, 75, 75, 75,
|
155
|
-
75, 75, 1, 2, 76, 76, 76, 76, 76, 1, 2, 77,
|
156
|
-
77, 77, 77, 77, 1, 2, 78, 78, 78, 78, 78, 1,
|
157
|
-
2, 1, 1, 0
|
128
|
+
25, 29, 28, 30, 1, 1, 1, 1, 1, 31, 32, 1,
|
129
|
+
1, 1, 1, 1, 33, 34, 35, 34, 34, 34, 34, 1,
|
130
|
+
8, 1, 9, 1, 1, 1, 1, 35, 36, 1, 38, 39,
|
131
|
+
1, 1, 40, 1, 1, 37, 8, 1, 9, 1, 1, 42,
|
132
|
+
1, 1, 41, 43, 1, 45, 1, 1, 1, 1, 44, 46,
|
133
|
+
1, 48, 1, 1, 1, 1, 47, 2, 49, 49, 49, 49,
|
134
|
+
49, 1, 2, 50, 50, 50, 50, 50, 1, 2, 51, 51,
|
135
|
+
51, 51, 51, 1, 2, 52, 52, 52, 52, 52, 1, 2,
|
136
|
+
53, 53, 53, 53, 53, 1, 2, 54, 54, 54, 54, 54,
|
137
|
+
1, 2, 55, 55, 55, 55, 55, 1, 2, 56, 56, 56,
|
138
|
+
56, 56, 1, 2, 57, 57, 57, 57, 57, 1, 2, 58,
|
139
|
+
58, 58, 58, 58, 1, 2, 59, 59, 59, 59, 59, 1,
|
140
|
+
2, 60, 60, 60, 60, 60, 1, 2, 61, 61, 61, 61,
|
141
|
+
61, 1, 2, 62, 62, 62, 62, 62, 1, 2, 63, 63,
|
142
|
+
63, 63, 63, 1, 2, 64, 64, 64, 64, 64, 1, 2,
|
143
|
+
65, 65, 65, 65, 65, 1, 2, 66, 66, 66, 66, 66,
|
144
|
+
1, 2, 1, 1, 0
|
158
145
|
};
|
159
146
|
}
|
160
147
|
|
@@ -164,13 +151,12 @@ private static final byte _puma_parser_indicies[] = init__puma_parser_indicies_0
|
|
164
151
|
private static byte[] init__puma_parser_trans_targs_0()
|
165
152
|
{
|
166
153
|
return new byte [] {
|
167
|
-
2, 0, 3,
|
168
|
-
8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
|
169
|
-
18, 19, 14, 18, 19, 14, 5, 21,
|
170
|
-
|
171
|
-
31, 32,
|
172
|
-
|
173
|
-
50, 51, 52, 53, 54, 55, 56
|
154
|
+
2, 0, 3, 28, 4, 22, 24, 23, 5, 20, 6, 7,
|
155
|
+
8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 47, 17,
|
156
|
+
18, 19, 14, 18, 19, 14, 5, 21, 5, 21, 22, 23,
|
157
|
+
5, 24, 20, 25, 26, 25, 26, 5, 27, 20, 5, 27,
|
158
|
+
20, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
|
159
|
+
40, 41, 42, 43, 44, 45, 46
|
174
160
|
};
|
175
161
|
}
|
176
162
|
|
@@ -182,10 +168,9 @@ private static byte[] init__puma_parser_trans_actions_0()
|
|
182
168
|
return new byte [] {
|
183
169
|
1, 0, 11, 0, 1, 1, 1, 1, 13, 13, 1, 0,
|
184
170
|
0, 0, 0, 0, 0, 0, 19, 0, 0, 28, 23, 3,
|
185
|
-
5, 7, 31, 7, 0, 9, 25, 1,
|
186
|
-
|
187
|
-
|
188
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
171
|
+
5, 7, 31, 7, 0, 9, 25, 1, 15, 0, 0, 0,
|
172
|
+
37, 0, 37, 21, 21, 0, 0, 40, 17, 40, 34, 0,
|
173
|
+
34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
189
174
|
0, 0, 0, 0, 0, 0, 0
|
190
175
|
};
|
191
176
|
}
|
@@ -194,7 +179,7 @@ private static final byte _puma_parser_trans_actions[] = init__puma_parser_trans
|
|
194
179
|
|
195
180
|
|
196
181
|
static final int puma_parser_start = 1;
|
197
|
-
static final int puma_parser_first_final =
|
182
|
+
static final int puma_parser_first_final = 47;
|
198
183
|
static final int puma_parser_error = 0;
|
199
184
|
|
200
185
|
static final int puma_parser_en_main = 1;
|
@@ -236,7 +221,7 @@ static final int puma_parser_en_main = 1;
|
|
236
221
|
cs = 0;
|
237
222
|
|
238
223
|
|
239
|
-
// line
|
224
|
+
// line 225 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
|
240
225
|
{
|
241
226
|
cs = puma_parser_start;
|
242
227
|
}
|
@@ -268,7 +253,7 @@ static final int puma_parser_en_main = 1;
|
|
268
253
|
parser.buffer = buffer;
|
269
254
|
|
270
255
|
|
271
|
-
// line
|
256
|
+
// line 257 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
|
272
257
|
{
|
273
258
|
int _klen;
|
274
259
|
int _trans = 0;
|
@@ -433,7 +418,7 @@ case 1:
|
|
433
418
|
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
434
419
|
}
|
435
420
|
break;
|
436
|
-
// line
|
421
|
+
// line 422 "ext/puma_http11/org/jruby/puma/Http11Parser.java"
|
437
422
|
}
|
438
423
|
}
|
439
424
|
}
|
data/lib/puma/binder.rb
CHANGED
@@ -179,20 +179,22 @@ module Puma
|
|
179
179
|
end
|
180
180
|
|
181
181
|
ctx.ca = params['ca'] if params['ca']
|
182
|
+
end
|
182
183
|
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
184
|
+
if params['verify_mode']
|
185
|
+
ctx.verify_mode = case params['verify_mode']
|
186
|
+
when "peer"
|
187
|
+
MiniSSL::VERIFY_PEER
|
188
|
+
when "force_peer"
|
189
|
+
MiniSSL::VERIFY_PEER | MiniSSL::VERIFY_FAIL_IF_NO_PEER_CERT
|
190
|
+
when "none"
|
191
|
+
MiniSSL::VERIFY_NONE
|
192
|
+
else
|
193
|
+
@events.error "Please specify a valid verify_mode="
|
194
|
+
MiniSSL::VERIFY_NONE
|
195
|
+
end
|
196
|
+
else
|
197
|
+
ctx.verify_mode = MiniSSL::VERIFY_PEER
|
196
198
|
end
|
197
199
|
|
198
200
|
if fd = @inherited_fds.delete(str)
|
@@ -240,7 +242,11 @@ module Puma
|
|
240
242
|
# We have to unlink a unix socket path that's not being used
|
241
243
|
File.unlink key[1] if key[0] == :unix
|
242
244
|
end
|
245
|
+
end
|
243
246
|
|
247
|
+
def localhost_addresses
|
248
|
+
addrs = TCPSocket.gethostbyname "localhost"
|
249
|
+
addrs[3..-1]
|
244
250
|
end
|
245
251
|
|
246
252
|
# Tell the server to listen on host +host+, port +port+.
|
@@ -251,6 +257,13 @@ module Puma
|
|
251
257
|
# allow to accumulate before returning connection refused.
|
252
258
|
#
|
253
259
|
def add_tcp_listener(host, port, optimize_for_latency=true, backlog=1024)
|
260
|
+
if host == "localhost"
|
261
|
+
localhost_addresses.each do |addr|
|
262
|
+
add_tcp_listener addr, port, optimize_for_latency, backlog
|
263
|
+
end
|
264
|
+
return
|
265
|
+
end
|
266
|
+
|
254
267
|
host = host[1..-2] if host and host[0..0] == '['
|
255
268
|
s = TCPServer.new(host, port)
|
256
269
|
if optimize_for_latency
|
@@ -283,6 +296,13 @@ module Puma
|
|
283
296
|
|
284
297
|
MiniSSL.check
|
285
298
|
|
299
|
+
if host == "localhost"
|
300
|
+
localhost_addresses.each do |addr|
|
301
|
+
add_ssl_listener addr, port, optimize_for_latency, backlog
|
302
|
+
end
|
303
|
+
return
|
304
|
+
end
|
305
|
+
|
286
306
|
host = host[1..-2] if host[0..0] == '['
|
287
307
|
s = TCPServer.new(host, port)
|
288
308
|
if optimize_for_latency
|
data/lib/puma/cluster.rb
CHANGED
@@ -323,7 +323,7 @@ module Puma
|
|
323
323
|
@options[:preload_app]
|
324
324
|
end
|
325
325
|
|
326
|
-
# We do this in a separate method to keep the
|
326
|
+
# We do this in a separate method to keep the lambda scope
|
327
327
|
# of the signals handlers as small as possible.
|
328
328
|
def setup_signals
|
329
329
|
Signal.trap "SIGCHLD" do
|
data/lib/puma/configuration.rb
CHANGED
@@ -181,7 +181,8 @@ module Puma
|
|
181
181
|
:tag => method(:infer_tag),
|
182
182
|
:environment => lambda { ENV['RACK_ENV'] || "development" },
|
183
183
|
:rackup => DefaultRackup,
|
184
|
-
:logger => STDOUT
|
184
|
+
:logger => STDOUT,
|
185
|
+
:persistent_timeout => Const::PERSISTENT_TIMEOUT
|
185
186
|
}
|
186
187
|
end
|
187
188
|
|
@@ -245,7 +246,8 @@ module Puma
|
|
245
246
|
require 'puma/tcp_logger'
|
246
247
|
|
247
248
|
logger = @options[:logger]
|
248
|
-
|
249
|
+
quiet = !@options[:log_requests]
|
250
|
+
return TCPLogger.new(logger, found, quiet)
|
249
251
|
end
|
250
252
|
|
251
253
|
if @options[:log_requests]
|
data/lib/puma/const.rb
CHANGED
@@ -100,8 +100,8 @@ module Puma
|
|
100
100
|
# too taxing on performance.
|
101
101
|
module Const
|
102
102
|
|
103
|
-
PUMA_VERSION = VERSION = "3.
|
104
|
-
CODE_NAME = "
|
103
|
+
PUMA_VERSION = VERSION = "3.5.0".freeze
|
104
|
+
CODE_NAME = "Amateur Raccoon Rocketry".freeze
|
105
105
|
PUMA_SERVER_STRING = ['puma', PUMA_VERSION, CODE_NAME].join(' ').freeze
|
106
106
|
|
107
107
|
FAST_TRACK_KA_TIMEOUT = 0.2
|
data/lib/puma/dsl.rb
CHANGED
@@ -133,6 +133,13 @@ module Puma
|
|
133
133
|
bind "tcp://#{host}:#{port}"
|
134
134
|
end
|
135
135
|
|
136
|
+
# Define how long persistent connections can be idle before puma closes
|
137
|
+
# them
|
138
|
+
#
|
139
|
+
def persistent_timeout(seconds)
|
140
|
+
@options[:persistent_timeout] = seconds
|
141
|
+
end
|
142
|
+
|
136
143
|
# Work around leaky apps that leave garbage in Thread locals
|
137
144
|
# across requests
|
138
145
|
#
|
@@ -259,9 +266,9 @@ module Puma
|
|
259
266
|
def ssl_bind(host, port, opts)
|
260
267
|
if defined?(JRUBY_VERSION)
|
261
268
|
keystore_additions = "keystore=#{opts[:keystore]}&keystore-pass=#{opts[:keystore_pass]}"
|
262
|
-
bind "ssl://#{host}:#{port}?cert=#{opts[:cert]}&key=#{opts[:key]}&#{keystore_additions}"
|
269
|
+
bind "ssl://#{host}:#{port}?cert=#{opts[:cert]}&key=#{opts[:key]}&#{keystore_additions}&verify_mode=#{opts[:verify_mode] || 'peer'}"
|
263
270
|
else
|
264
|
-
bind "ssl://#{host}:#{port}?cert=#{opts[:cert]}&key=#{opts[:key]}"
|
271
|
+
bind "ssl://#{host}:#{port}?cert=#{opts[:cert]}&key=#{opts[:key]}&verify_mode=#{opts[:verify_mode] || 'peer'}"
|
265
272
|
end
|
266
273
|
end
|
267
274
|
|
data/lib/puma/events.rb
CHANGED
@@ -106,15 +106,21 @@ module Puma
|
|
106
106
|
end
|
107
107
|
|
108
108
|
# An unknown error has occurred.
|
109
|
-
# +server+ is the Server object, +
|
110
|
-
#
|
109
|
+
# +server+ is the Server object, +error+ an exception object,
|
110
|
+
# +kind+ some additional info, and +env+ the request.
|
111
111
|
#
|
112
|
-
def unknown_error(server, error, kind="Unknown")
|
112
|
+
def unknown_error(server, error, kind="Unknown", env=nil)
|
113
113
|
if error.respond_to? :render
|
114
114
|
error.render "#{Time.now}: #{kind} error", @stderr
|
115
115
|
else
|
116
|
-
|
117
|
-
|
116
|
+
if env
|
117
|
+
string_block = [ "#{Time.now}: #{kind} error handling request { #{env['REQUEST_METHOD']} #{env['PATH_INFO']} }" ]
|
118
|
+
string_block << error.inspect
|
119
|
+
else
|
120
|
+
string_block = [ "#{Time.now}: #{kind} error: #{error.inspect}" ]
|
121
|
+
end
|
122
|
+
string_block << error.backtrace
|
123
|
+
@stderr.puts string_block.join("\n")
|
118
124
|
end
|
119
125
|
end
|
120
126
|
|
data/lib/puma/reactor.rb
CHANGED
@@ -75,6 +75,15 @@ module Puma
|
|
75
75
|
sockets.delete c
|
76
76
|
end
|
77
77
|
|
78
|
+
# Don't report these to the lowlevel_error handler, otherwise
|
79
|
+
# will be flooding them with errors when persistent connections
|
80
|
+
# are closed.
|
81
|
+
rescue ConnectionError
|
82
|
+
c.write_500
|
83
|
+
c.close
|
84
|
+
|
85
|
+
sockets.delete c
|
86
|
+
|
78
87
|
# SSL handshake failure
|
79
88
|
rescue MiniSSL::SSLError => e
|
80
89
|
@server.lowlevel_error(e, c.env)
|
data/lib/puma/server.rb
CHANGED
@@ -63,7 +63,7 @@ module Puma
|
|
63
63
|
@thread = nil
|
64
64
|
@thread_pool = nil
|
65
65
|
|
66
|
-
@persistent_timeout =
|
66
|
+
@persistent_timeout = options[:persistent_timeout]
|
67
67
|
|
68
68
|
@binder = Binder.new(events)
|
69
69
|
@own_binder = true
|
@@ -588,7 +588,7 @@ module Puma
|
|
588
588
|
res_body = ["Request was internally terminated early\n"]
|
589
589
|
|
590
590
|
rescue StandardError => e
|
591
|
-
@events.unknown_error self, e, "Rack app"
|
591
|
+
@events.unknown_error self, e, "Rack app", env
|
592
592
|
|
593
593
|
status, headers, res_body = lowlevel_error(e, env)
|
594
594
|
end
|
data/lib/puma/tcp_logger.rb
CHANGED
@@ -11,7 +11,14 @@ module Puma
|
|
11
11
|
def log(who, str)
|
12
12
|
now = Time.now.strftime("%d/%b/%Y %H:%M:%S")
|
13
13
|
|
14
|
-
|
14
|
+
log_str = "#{now} - #{who} - #{str}"
|
15
|
+
|
16
|
+
case @logger
|
17
|
+
when IO
|
18
|
+
@logger.puts log_str
|
19
|
+
when Events
|
20
|
+
@logger.log log_str
|
21
|
+
end
|
15
22
|
end
|
16
23
|
|
17
24
|
def call(env, socket)
|