puma 2.11.3 → 2.12.0
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.
Potentially problematic release.
This version of puma might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/DEPLOYMENT.md +1 -2
- data/Gemfile +1 -1
- data/History.txt +49 -0
- data/Manifest.txt +5 -1
- data/README.md +14 -0
- data/Rakefile +1 -1
- data/ext/puma_http11/mini_ssl.c +132 -9
- data/lib/puma/binder.rb +31 -10
- data/lib/puma/capistrano.rb +8 -3
- data/lib/puma/cli.rb +21 -26
- data/lib/puma/cluster.rb +2 -0
- data/lib/puma/commonlogger.rb +107 -0
- data/lib/puma/configuration.rb +5 -3
- data/lib/puma/const.rb +81 -8
- data/lib/puma/control_cli.rb +9 -1
- data/lib/puma/events.rb +9 -0
- data/lib/puma/minissl.rb +23 -0
- data/lib/puma/rack/backports/uri/common_18.rb +56 -0
- data/lib/puma/rack/backports/uri/common_192.rb +52 -0
- data/lib/puma/rack/backports/uri/common_193.rb +29 -0
- data/lib/puma/rack/builder.rb +298 -0
- data/lib/puma/reactor.rb +11 -0
- data/lib/puma/server.rb +44 -14
- data/lib/puma/thread_pool.rb +50 -1
- data/lib/puma/util.rb +123 -0
- data/puma.gemspec +0 -3
- data/tools/jungle/upstart/puma.conf +7 -1
- metadata +22 -18
- data/lib/puma/rack_patch.rb +0 -45
data/lib/puma/rack_patch.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'rack/commonlogger'
|
2
|
-
|
3
|
-
module Rack
|
4
|
-
# Patch CommonLogger to use after_reply.
|
5
|
-
#
|
6
|
-
# Simply request this file and CommonLogger will be a bit more
|
7
|
-
# efficient.
|
8
|
-
class CommonLogger
|
9
|
-
remove_method :call
|
10
|
-
|
11
|
-
def call(env)
|
12
|
-
began_at = Time.now
|
13
|
-
status, header, body = @app.call(env)
|
14
|
-
header = Utils::HeaderHash.new(header)
|
15
|
-
|
16
|
-
# If we've been hijacked, then output a special line
|
17
|
-
if env['rack.hijack_io']
|
18
|
-
log_hijacking(env, 'HIJACK', header, began_at)
|
19
|
-
elsif ary = env['rack.after_reply']
|
20
|
-
ary << lambda { log(env, status, header, began_at) }
|
21
|
-
else
|
22
|
-
body = BodyProxy.new(body) { log(env, status, header, began_at) }
|
23
|
-
end
|
24
|
-
|
25
|
-
[status, header, body]
|
26
|
-
end
|
27
|
-
|
28
|
-
HIJACK_FORMAT = %{%s - %s [%s] "%s %s%s %s" HIJACKED -1 %0.4f\n}
|
29
|
-
|
30
|
-
def log_hijacking(env, status, header, began_at)
|
31
|
-
now = Time.now
|
32
|
-
|
33
|
-
logger = @logger || env['rack.errors']
|
34
|
-
logger.write HIJACK_FORMAT % [
|
35
|
-
env['HTTP_X_FORWARDED_FOR'] || env["REMOTE_ADDR"] || "-",
|
36
|
-
env["REMOTE_USER"] || "-",
|
37
|
-
now.strftime("%d/%b/%Y %H:%M:%S"),
|
38
|
-
env["REQUEST_METHOD"],
|
39
|
-
env["PATH_INFO"],
|
40
|
-
env["QUERY_STRING"].empty? ? "" : "?"+env["QUERY_STRING"],
|
41
|
-
env["HTTP_VERSION"],
|
42
|
-
now - began_at ]
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|