puma 3.9.1 → 4.3.1
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.md +232 -0
- data/README.md +162 -224
- data/docs/architecture.md +37 -0
- data/{DEPLOYMENT.md → docs/deployment.md} +24 -4
- 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 +38 -0
- data/docs/restart.md +41 -0
- data/docs/signals.md +56 -3
- data/docs/systemd.md +130 -37
- data/docs/tcp_mode.md +96 -0
- data/ext/puma_http11/PumaHttp11Service.java +2 -0
- data/ext/puma_http11/extconf.rb +13 -0
- data/ext/puma_http11/http11_parser.c +115 -140
- data/ext/puma_http11/http11_parser.java.rl +21 -37
- data/ext/puma_http11/http11_parser.rl +9 -9
- data/ext/puma_http11/http11_parser_common.rl +3 -3
- data/ext/puma_http11/mini_ssl.c +104 -8
- data/ext/puma_http11/org/jruby/puma/Http11.java +106 -114
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +90 -108
- data/ext/puma_http11/org/jruby/puma/IOBuffer.java +72 -0
- data/ext/puma_http11/org/jruby/puma/MiniSSL.java +21 -4
- data/ext/puma_http11/puma_http11.c +2 -0
- data/lib/puma.rb +16 -0
- data/lib/puma/accept_nonblock.rb +7 -1
- data/lib/puma/app/status.rb +40 -26
- data/lib/puma/binder.rb +57 -74
- data/lib/puma/cli.rb +26 -7
- data/lib/puma/client.rb +243 -190
- data/lib/puma/cluster.rb +78 -34
- data/lib/puma/commonlogger.rb +2 -0
- data/lib/puma/configuration.rb +24 -16
- data/lib/puma/const.rb +36 -18
- data/lib/puma/control_cli.rb +46 -19
- data/lib/puma/detect.rb +2 -0
- data/lib/puma/dsl.rb +329 -68
- data/lib/puma/events.rb +6 -1
- data/lib/puma/io_buffer.rb +3 -6
- data/lib/puma/jruby_restart.rb +2 -1
- data/lib/puma/launcher.rb +120 -58
- data/lib/puma/minissl.rb +69 -27
- data/lib/puma/minissl/context_builder.rb +76 -0
- data/lib/puma/null_io.rb +2 -0
- data/lib/puma/plugin.rb +7 -2
- data/lib/puma/plugin/tmp_restart.rb +2 -1
- data/lib/puma/rack/builder.rb +4 -1
- data/lib/puma/rack/urlmap.rb +2 -0
- data/lib/puma/rack_default.rb +2 -0
- data/lib/puma/reactor.rb +224 -34
- data/lib/puma/runner.rb +25 -4
- data/lib/puma/server.rb +148 -62
- data/lib/puma/single.rb +16 -5
- data/lib/puma/state_file.rb +2 -0
- data/lib/puma/tcp_logger.rb +2 -0
- data/lib/puma/thread_pool.rb +61 -38
- data/lib/puma/util.rb +2 -6
- data/lib/rack/handler/puma.rb +10 -4
- data/tools/docker/Dockerfile +16 -0
- data/tools/jungle/README.md +12 -2
- data/tools/jungle/init.d/README.md +2 -0
- data/tools/jungle/init.d/puma +8 -8
- data/tools/jungle/init.d/run-puma +1 -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 -2
- metadata +29 -56
- data/.github/issue_template.md +0 -20
- data/Gemfile +0 -14
- data/Manifest.txt +0 -78
- data/Rakefile +0 -165
- data/Release.md +0 -9
- data/gemfiles/2.1-Gemfile +0 -12
- data/lib/puma/compat.rb +0 -14
- data/lib/puma/convenient.rb +0 -23
- data/lib/puma/daemon_ext.rb +0 -31
- data/lib/puma/delegation.rb +0 -11
- data/lib/puma/java_io_buffer.rb +0 -45
- data/lib/puma/rack/backports/uri/common_193.rb +0 -33
- data/puma.gemspec +0 -20
data/Release.md
DELETED
data/gemfiles/2.1-Gemfile
DELETED
data/lib/puma/compat.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# Provides code to work properly on 1.8 and 1.9
|
2
|
-
|
3
|
-
class String
|
4
|
-
unless method_defined? :bytesize
|
5
|
-
alias_method :bytesize, :size
|
6
|
-
end
|
7
|
-
|
8
|
-
unless method_defined? :byteslice
|
9
|
-
def byteslice(*arg)
|
10
|
-
enc = self.encoding
|
11
|
-
self.dup.force_encoding(Encoding::ASCII_8BIT).slice(*arg).force_encoding(enc)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
data/lib/puma/convenient.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'puma/launcher'
|
2
|
-
require 'puma/configuration'
|
3
|
-
|
4
|
-
module Puma
|
5
|
-
def self.run(opts={})
|
6
|
-
cfg = Puma::Configuration.new do |user_config|
|
7
|
-
if port = opts[:port]
|
8
|
-
user_config.port port
|
9
|
-
end
|
10
|
-
|
11
|
-
user_config.quiet
|
12
|
-
|
13
|
-
yield c
|
14
|
-
end
|
15
|
-
|
16
|
-
cfg.clamp
|
17
|
-
|
18
|
-
events = Puma::Events.null
|
19
|
-
|
20
|
-
launcher = Puma::Launcher.new cfg, :events => events
|
21
|
-
launcher.run
|
22
|
-
end
|
23
|
-
end
|
data/lib/puma/daemon_ext.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
module Process
|
2
|
-
|
3
|
-
# This overrides the default version because it is broken if it
|
4
|
-
# exists.
|
5
|
-
|
6
|
-
if respond_to? :daemon
|
7
|
-
class << self
|
8
|
-
remove_method :daemon
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.daemon(nochdir=false, noclose=false)
|
13
|
-
exit if fork # Parent exits, child continues.
|
14
|
-
|
15
|
-
Process.setsid # Become session leader.
|
16
|
-
|
17
|
-
exit if fork # Zap session leader. See [1].
|
18
|
-
|
19
|
-
Dir.chdir "/" unless nochdir # Release old working directory.
|
20
|
-
|
21
|
-
if !noclose
|
22
|
-
STDIN.reopen File.open("/dev/null", "r")
|
23
|
-
|
24
|
-
null_out = File.open "/dev/null", "w"
|
25
|
-
STDOUT.reopen null_out
|
26
|
-
STDERR.reopen null_out
|
27
|
-
end
|
28
|
-
|
29
|
-
0
|
30
|
-
end
|
31
|
-
end
|
data/lib/puma/delegation.rb
DELETED
data/lib/puma/java_io_buffer.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'java'
|
2
|
-
|
3
|
-
# Conservative native JRuby/Java implementation of IOBuffer
|
4
|
-
# backed by a ByteArrayOutputStream and conversion between
|
5
|
-
# Ruby String and Java bytes
|
6
|
-
module Puma
|
7
|
-
class JavaIOBuffer < java.io.ByteArrayOutputStream
|
8
|
-
field_reader :buf
|
9
|
-
end
|
10
|
-
|
11
|
-
class IOBuffer
|
12
|
-
BUF_DEFAULT_SIZE = 4096
|
13
|
-
|
14
|
-
def initialize
|
15
|
-
@buf = JavaIOBuffer.new(BUF_DEFAULT_SIZE)
|
16
|
-
end
|
17
|
-
|
18
|
-
def reset
|
19
|
-
@buf.reset
|
20
|
-
end
|
21
|
-
|
22
|
-
def <<(str)
|
23
|
-
bytes = str.to_java_bytes
|
24
|
-
@buf.write(bytes, 0, bytes.length)
|
25
|
-
end
|
26
|
-
|
27
|
-
def append(*strs)
|
28
|
-
strs.each { |s| self << s; }
|
29
|
-
end
|
30
|
-
|
31
|
-
def to_s
|
32
|
-
String.from_java_bytes @buf.to_byte_array
|
33
|
-
end
|
34
|
-
|
35
|
-
alias_method :to_str, :to_s
|
36
|
-
|
37
|
-
def used
|
38
|
-
@buf.size
|
39
|
-
end
|
40
|
-
|
41
|
-
def capacity
|
42
|
-
@buf.buf.length
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# :stopdoc:
|
2
|
-
|
3
|
-
require 'uri/common'
|
4
|
-
|
5
|
-
# Issue:
|
6
|
-
# http://bugs.ruby-lang.org/issues/5925
|
7
|
-
#
|
8
|
-
# Relevant commit:
|
9
|
-
# https://github.com/ruby/ruby/commit/edb7cdf1eabaff78dfa5ffedfbc2e91b29fa9ca1
|
10
|
-
|
11
|
-
|
12
|
-
module URI
|
13
|
-
begin
|
14
|
-
256.times do |i|
|
15
|
-
TBLENCWWWCOMP_[i.chr] = '%%%02X' % i
|
16
|
-
end
|
17
|
-
TBLENCWWWCOMP_[' '] = '+'
|
18
|
-
TBLENCWWWCOMP_.freeze
|
19
|
-
|
20
|
-
256.times do |i|
|
21
|
-
h, l = i>>4, i&15
|
22
|
-
TBLDECWWWCOMP_['%%%X%X' % [h, l]] = i.chr
|
23
|
-
TBLDECWWWCOMP_['%%%x%X' % [h, l]] = i.chr
|
24
|
-
TBLDECWWWCOMP_['%%%X%x' % [h, l]] = i.chr
|
25
|
-
TBLDECWWWCOMP_['%%%x%x' % [h, l]] = i.chr
|
26
|
-
end
|
27
|
-
TBLDECWWWCOMP_['+'] = ' '
|
28
|
-
TBLDECWWWCOMP_.freeze
|
29
|
-
rescue Exception
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
# :startdoc:
|
data/puma.gemspec
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
# This is only used when puma is a git dep from Bundler, keep in sync with Rakefile
|
4
|
-
|
5
|
-
version = File.read(File.expand_path("../lib/puma/const.rb", __FILE__))[/VERSION = "(\d+\.\d+\.\d+)"/, 1] || raise
|
6
|
-
|
7
|
-
Gem::Specification.new do |s|
|
8
|
-
s.name = "puma"
|
9
|
-
s.version = version
|
10
|
-
s.authors = ["Evan Phoenix"]
|
11
|
-
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."
|
12
|
-
s.summary = "Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications"
|
13
|
-
s.email = ["evan@phx.io"]
|
14
|
-
s.executables = ["puma", "pumactl"]
|
15
|
-
s.extensions = ["ext/puma_http11/extconf.rb"]
|
16
|
-
s.files = `git ls-files`.split($/)
|
17
|
-
s.homepage = "http://puma.io"
|
18
|
-
s.license = "BSD-3-Clause"
|
19
|
-
s.required_ruby_version = Gem::Requirement.new(">= 1.9.3")
|
20
|
-
end
|