puma 3.5.0 → 3.12.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 +5 -5
- data/{History.txt → History.md} +318 -75
- data/README.md +143 -227
- data/docs/architecture.md +36 -0
- data/{DEPLOYMENT.md → docs/deployment.md} +0 -0
- data/docs/images/puma-connection-flow-no-reactor.png +0 -0
- data/docs/images/puma-connection-flow.png +0 -0
- data/docs/images/puma-general-arch.png +0 -0
- data/docs/plugins.md +28 -0
- data/docs/restart.md +39 -0
- data/docs/signals.md +56 -3
- data/docs/systemd.md +124 -22
- data/ext/puma_http11/extconf.rb +2 -0
- data/ext/puma_http11/http11_parser.c +85 -84
- data/ext/puma_http11/http11_parser.h +1 -0
- data/ext/puma_http11/http11_parser.rl +10 -9
- data/ext/puma_http11/io_buffer.c +7 -7
- data/ext/puma_http11/mini_ssl.c +67 -6
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +13 -16
- data/ext/puma_http11/org/jruby/puma/MiniSSL.java +15 -2
- data/ext/puma_http11/puma_http11.c +1 -0
- data/lib/puma.rb +13 -5
- data/lib/puma/app/status.rb +8 -0
- data/lib/puma/binder.rb +22 -17
- data/lib/puma/cli.rb +49 -33
- data/lib/puma/client.rb +149 -4
- data/lib/puma/cluster.rb +54 -12
- data/lib/puma/commonlogger.rb +19 -20
- data/lib/puma/compat.rb +3 -7
- data/lib/puma/configuration.rb +133 -130
- data/lib/puma/const.rb +19 -37
- data/lib/puma/control_cli.rb +38 -35
- data/lib/puma/convenient.rb +3 -3
- data/lib/puma/detect.rb +3 -1
- data/lib/puma/dsl.rb +80 -58
- data/lib/puma/events.rb +6 -8
- data/lib/puma/io_buffer.rb +1 -1
- data/lib/puma/jruby_restart.rb +0 -1
- data/lib/puma/launcher.rb +61 -30
- data/lib/puma/minissl.rb +85 -4
- data/lib/puma/null_io.rb +6 -13
- data/lib/puma/plugin.rb +12 -1
- data/lib/puma/plugin/tmp_restart.rb +1 -2
- data/lib/puma/rack/builder.rb +3 -0
- data/lib/puma/rack/urlmap.rb +9 -8
- data/lib/puma/reactor.rb +135 -0
- data/lib/puma/runner.rb +27 -1
- data/lib/puma/server.rb +134 -32
- data/lib/puma/single.rb +17 -3
- data/lib/puma/thread_pool.rb +67 -20
- data/lib/puma/util.rb +1 -5
- data/lib/rack/handler/puma.rb +58 -17
- data/tools/jungle/README.md +12 -2
- data/tools/jungle/init.d/README.md +9 -2
- data/tools/jungle/init.d/puma +32 -62
- data/tools/jungle/init.d/run-puma +5 -1
- data/tools/jungle/rc.d/README.md +74 -0
- data/tools/jungle/rc.d/puma +61 -0
- data/tools/jungle/rc.d/puma.conf +10 -0
- data/tools/trickletest.rb +1 -1
- metadata +22 -92
- data/Gemfile +0 -13
- data/Manifest.txt +0 -77
- data/Rakefile +0 -158
- data/lib/puma/rack/backports/uri/common_18.rb +0 -59
- data/lib/puma/rack/backports/uri/common_192.rb +0 -55
- data/puma.gemspec +0 -52
@@ -1,59 +0,0 @@
|
|
1
|
-
# :stopdoc:
|
2
|
-
|
3
|
-
# Stolen from ruby core's uri/common.rb, with modifications to support 1.8.x
|
4
|
-
#
|
5
|
-
# https://github.com/ruby/ruby/blob/trunk/lib/uri/common.rb
|
6
|
-
#
|
7
|
-
#
|
8
|
-
|
9
|
-
module URI
|
10
|
-
begin
|
11
|
-
TBLENCWWWCOMP_ = {} # :nodoc:
|
12
|
-
256.times do |i|
|
13
|
-
TBLENCWWWCOMP_[i.chr] = '%%%02X' % i
|
14
|
-
end
|
15
|
-
TBLENCWWWCOMP_[' '] = '+'
|
16
|
-
TBLENCWWWCOMP_.freeze
|
17
|
-
TBLDECWWWCOMP_ = {} # :nodoc:
|
18
|
-
256.times do |i|
|
19
|
-
h, l = i>>4, i&15
|
20
|
-
TBLDECWWWCOMP_['%%%X%X' % [h, l]] = i.chr
|
21
|
-
TBLDECWWWCOMP_['%%%x%X' % [h, l]] = i.chr
|
22
|
-
TBLDECWWWCOMP_['%%%X%x' % [h, l]] = i.chr
|
23
|
-
TBLDECWWWCOMP_['%%%x%x' % [h, l]] = i.chr
|
24
|
-
end
|
25
|
-
TBLDECWWWCOMP_['+'] = ' '
|
26
|
-
TBLDECWWWCOMP_.freeze
|
27
|
-
rescue Exception
|
28
|
-
end
|
29
|
-
|
30
|
-
# Encode given +s+ to URL-encoded form data.
|
31
|
-
#
|
32
|
-
# This method doesn't convert *, -, ., 0-9, A-Z, _, a-z, but does convert SP
|
33
|
-
# (ASCII space) to + and converts others to %XX.
|
34
|
-
#
|
35
|
-
# This is an implementation of
|
36
|
-
# http://www.w3.org/TR/html5/forms.html#url-encoded-form-data
|
37
|
-
#
|
38
|
-
# See URI.decode_www_form_component, URI.encode_www_form
|
39
|
-
def self.encode_www_form_component(s)
|
40
|
-
str = s.to_s
|
41
|
-
if RUBY_VERSION < "1.9" && $KCODE =~ /u/i
|
42
|
-
str.gsub(/([^ a-zA-Z0-9_.-]+)/) do
|
43
|
-
'%' + $1.unpack('H2' * Rack::Utils.bytesize($1)).join('%').upcase
|
44
|
-
end.tr(' ', '+')
|
45
|
-
else
|
46
|
-
str.gsub(/[^*\-.0-9A-Z_a-z]/) {|m| TBLENCWWWCOMP_[m]}
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
# Decode given +str+ of URL-encoded form data.
|
51
|
-
#
|
52
|
-
# This decodes + to SP.
|
53
|
-
#
|
54
|
-
# See URI.encode_www_form_component, URI.decode_www_form
|
55
|
-
def self.decode_www_form_component(str, enc=nil)
|
56
|
-
raise ArgumentError, "invalid %-encoding (#{str})" unless /\A(?:%[0-9a-fA-F]{2}|[^%])*\z/ =~ str
|
57
|
-
str.gsub(/\+|%[0-9a-fA-F]{2}/) {|m| TBLDECWWWCOMP_[m]}
|
58
|
-
end
|
59
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# :stopdoc:
|
2
|
-
|
3
|
-
# Stolen from ruby core's uri/common.rb @32618ba to fix DoS issues in 1.9.2
|
4
|
-
#
|
5
|
-
# https://github.com/ruby/ruby/blob/32618ba7438a2247042bba9b5d85b5d49070f5e5/lib/uri/common.rb
|
6
|
-
#
|
7
|
-
# Issue:
|
8
|
-
# http://redmine.ruby-lang.org/issues/5149
|
9
|
-
#
|
10
|
-
# Relevant Fixes:
|
11
|
-
# https://github.com/ruby/ruby/commit/b5f91deee04aa6ccbe07c23c8222b937c22a799b
|
12
|
-
# https://github.com/ruby/ruby/commit/93177c1e5c3906abf14472ae0b905d8b5c72ce1b
|
13
|
-
#
|
14
|
-
# This should probably be removed once there is a Ruby 1.9.2 patch level that
|
15
|
-
# includes this fix.
|
16
|
-
|
17
|
-
require 'uri/common'
|
18
|
-
|
19
|
-
module URI
|
20
|
-
begin
|
21
|
-
TBLDECWWWCOMP_ = {} unless const_defined?(:TBLDECWWWCOMP_) #:nodoc:
|
22
|
-
if TBLDECWWWCOMP_.empty?
|
23
|
-
256.times do |i|
|
24
|
-
h, l = i>>4, i&15
|
25
|
-
TBLDECWWWCOMP_['%%%X%X' % [h, l]] = i.chr
|
26
|
-
TBLDECWWWCOMP_['%%%x%X' % [h, l]] = i.chr
|
27
|
-
TBLDECWWWCOMP_['%%%X%x' % [h, l]] = i.chr
|
28
|
-
TBLDECWWWCOMP_['%%%x%x' % [h, l]] = i.chr
|
29
|
-
end
|
30
|
-
TBLDECWWWCOMP_['+'] = ' '
|
31
|
-
TBLDECWWWCOMP_.freeze
|
32
|
-
end
|
33
|
-
rescue Exception
|
34
|
-
end
|
35
|
-
|
36
|
-
def self.decode_www_form(str, enc=Encoding::UTF_8)
|
37
|
-
return [] if str.empty?
|
38
|
-
unless /\A#{WFKV_}=#{WFKV_}(?:[;&]#{WFKV_}=#{WFKV_})*\z/o =~ str
|
39
|
-
raise ArgumentError, "invalid data of application/x-www-form-urlencoded (#{str})"
|
40
|
-
end
|
41
|
-
ary = []
|
42
|
-
$&.scan(/([^=;&]+)=([^;&]*)/) do
|
43
|
-
ary << [decode_www_form_component($1, enc), decode_www_form_component($2, enc)]
|
44
|
-
end
|
45
|
-
ary
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.decode_www_form_component(str, enc=Encoding::UTF_8)
|
49
|
-
raise ArgumentError, "invalid %-encoding (#{str})" unless /\A[^%]*(?:%\h\h[^%]*)*\z/ =~ str
|
50
|
-
str.gsub(/\+|%\h\h/, TBLDECWWWCOMP_).force_encoding(enc)
|
51
|
-
end
|
52
|
-
|
53
|
-
remove_const :WFKV_ if const_defined?(:WFKV_)
|
54
|
-
WFKV_ = '(?:[^%#=;&]*(?:%\h\h[^%#=;&]*)*)' # :nodoc:
|
55
|
-
end
|
data/puma.gemspec
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
# This is only used when puma is a git dep from Bundler, so it's a little
|
4
|
-
# weird.
|
5
|
-
|
6
|
-
d = File.read(File.expand_path("../lib/puma/const.rb", __FILE__))
|
7
|
-
if d =~ /VERSION = "(\d+\.\d+\.\d+)"/
|
8
|
-
version = $1
|
9
|
-
else
|
10
|
-
version = "0.0.1"
|
11
|
-
end
|
12
|
-
|
13
|
-
Gem::Specification.new do |s|
|
14
|
-
s.name = "puma"
|
15
|
-
s.version = version
|
16
|
-
|
17
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
18
|
-
s.authors = ["Evan Phoenix"]
|
19
|
-
s.date = `git log --pretty="%ai" -n 1`.split(" ").first
|
20
|
-
s.description = "Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications. Puma is intended for use in both development and production environments. It's great for highly concurrent Ruby implementations such as Rubinius and JRuby as well as as providing process worker support to support CRuby well."
|
21
|
-
s.email = ["evan@phx.io"]
|
22
|
-
s.executables = ["puma", "pumactl"]
|
23
|
-
s.extensions = ["ext/puma_http11/extconf.rb"]
|
24
|
-
s.files = `git ls-files`.split($/)
|
25
|
-
s.homepage = "http://puma.io"
|
26
|
-
s.license = "BSD-3-Clause"
|
27
|
-
s.rdoc_options = ["--main", "README.md"]
|
28
|
-
s.require_paths = ["lib"]
|
29
|
-
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
|
30
|
-
s.rubyforge_project = "puma"
|
31
|
-
s.rubygems_version = "1.8.25"
|
32
|
-
s.summary = "Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications"
|
33
|
-
s.test_files = s.files.grep(/^test/)
|
34
|
-
|
35
|
-
if s.respond_to? :specification_version then
|
36
|
-
s.specification_version = 3
|
37
|
-
|
38
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
39
|
-
s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
|
40
|
-
s.add_development_dependency(%q<rake-compiler>, ["~> 0.8.0"])
|
41
|
-
s.add_development_dependency(%q<hoe>, ["~> 3.6"])
|
42
|
-
else
|
43
|
-
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
44
|
-
s.add_dependency(%q<rake-compiler>, ["~> 0.8.0"])
|
45
|
-
s.add_dependency(%q<hoe>, ["~> 3.6"])
|
46
|
-
end
|
47
|
-
else
|
48
|
-
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
49
|
-
s.add_dependency(%q<rake-compiler>, ["~> 0.8.0"])
|
50
|
-
s.add_dependency(%q<hoe>, ["~> 3.6"])
|
51
|
-
end
|
52
|
-
end
|