puma 5.6.4 → 6.0.2
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/History.md +163 -3
- data/README.md +21 -17
- data/bin/puma-wild +1 -1
- data/docs/compile_options.md +34 -0
- data/docs/fork_worker.md +1 -3
- data/docs/nginx.md +1 -1
- data/docs/testing_benchmarks_local_files.md +150 -0
- data/docs/testing_test_rackup_ci_files.md +36 -0
- data/ext/puma_http11/extconf.rb +18 -10
- data/ext/puma_http11/http11_parser.c +1 -1
- data/ext/puma_http11/http11_parser.h +1 -1
- data/ext/puma_http11/http11_parser.java.rl +2 -2
- data/ext/puma_http11/http11_parser.rl +2 -2
- data/ext/puma_http11/http11_parser_common.rl +2 -2
- data/ext/puma_http11/mini_ssl.c +63 -24
- data/ext/puma_http11/org/jruby/puma/Http11.java +3 -3
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +1 -1
- data/ext/puma_http11/org/jruby/puma/MiniSSL.java +166 -65
- data/ext/puma_http11/puma_http11.c +17 -9
- data/lib/puma/app/status.rb +6 -3
- data/lib/puma/binder.rb +37 -43
- data/lib/puma/cli.rb +11 -17
- data/lib/puma/client.rb +26 -13
- data/lib/puma/cluster/worker.rb +13 -11
- data/lib/puma/cluster/worker_handle.rb +4 -1
- data/lib/puma/cluster.rb +31 -30
- data/lib/puma/configuration.rb +74 -58
- data/lib/puma/const.rb +76 -88
- data/lib/puma/control_cli.rb +21 -18
- data/lib/puma/detect.rb +2 -0
- data/lib/puma/dsl.rb +97 -49
- data/lib/puma/error_logger.rb +17 -9
- data/lib/puma/events.rb +6 -126
- data/lib/puma/io_buffer.rb +39 -4
- data/lib/puma/jruby_restart.rb +2 -1
- data/lib/puma/launcher/bundle_pruner.rb +104 -0
- data/lib/puma/launcher.rb +107 -156
- data/lib/puma/log_writer.rb +137 -0
- data/lib/puma/minissl/context_builder.rb +23 -12
- data/lib/puma/minissl.rb +91 -15
- data/lib/puma/null_io.rb +5 -0
- data/lib/puma/plugin/tmp_restart.rb +1 -1
- data/lib/puma/rack/builder.rb +4 -4
- data/lib/puma/rack_default.rb +1 -1
- data/lib/puma/reactor.rb +4 -4
- data/lib/puma/request.rb +334 -162
- data/lib/puma/runner.rb +45 -20
- data/lib/puma/server.rb +55 -69
- data/lib/puma/single.rb +11 -11
- data/lib/puma/state_file.rb +2 -4
- data/lib/puma/systemd.rb +3 -2
- data/lib/puma/thread_pool.rb +16 -16
- data/lib/puma/util.rb +12 -14
- data/lib/puma.rb +12 -11
- data/lib/rack/handler/puma.rb +9 -9
- metadata +7 -3
- data/lib/puma/queue_close.rb +0 -26
data/lib/puma.rb
CHANGED
@@ -3,30 +3,33 @@
|
|
3
3
|
# Standard libraries
|
4
4
|
require 'socket'
|
5
5
|
require 'tempfile'
|
6
|
-
require 'time'
|
7
|
-
require 'etc'
|
8
6
|
require 'uri'
|
9
7
|
require 'stringio'
|
10
8
|
|
11
9
|
require 'thread'
|
12
10
|
|
11
|
+
# use require, see https://github.com/puma/puma/pull/2381
|
13
12
|
require 'puma/puma_http11'
|
14
|
-
|
15
|
-
|
13
|
+
|
14
|
+
require_relative 'puma/detect'
|
15
|
+
require_relative 'puma/json_serialization'
|
16
16
|
|
17
17
|
module Puma
|
18
|
-
|
19
|
-
|
20
|
-
autoload :
|
18
|
+
# when Puma is loaded via `Puma::CLI`, all files are loaded via
|
19
|
+
# `require_relative`. The below are for non-standard loading
|
20
|
+
autoload :Const, "#{__dir__}/puma/const"
|
21
|
+
autoload :Server, "#{__dir__}/puma/server"
|
22
|
+
autoload :Launcher, "#{__dir__}/puma/launcher"
|
23
|
+
autoload :LogWriter, "#{__dir__}/puma/log_writer"
|
21
24
|
|
22
25
|
# at present, MiniSSL::Engine is only defined in extension code (puma_http11),
|
23
26
|
# not in minissl.rb
|
24
27
|
HAS_SSL = const_defined?(:MiniSSL, false) && MiniSSL.const_defined?(:Engine, false)
|
25
28
|
|
26
|
-
HAS_UNIX_SOCKET = Object.const_defined?
|
29
|
+
HAS_UNIX_SOCKET = Object.const_defined?(:UNIXSocket) && !IS_WINDOWS
|
27
30
|
|
28
31
|
if HAS_SSL
|
29
|
-
|
32
|
+
require_relative 'puma/minissl'
|
30
33
|
else
|
31
34
|
module MiniSSL
|
32
35
|
# this class is defined so that it exists when Puma is compiled
|
@@ -69,9 +72,7 @@ module Puma
|
|
69
72
|
@get_stats.stats
|
70
73
|
end
|
71
74
|
|
72
|
-
# Thread name is new in Ruby 2.3
|
73
75
|
def self.set_thread_name(name)
|
74
|
-
return unless Thread.current.respond_to?(:name=)
|
75
76
|
Thread.current.name = "puma #{name}"
|
76
77
|
end
|
77
78
|
end
|
data/lib/rack/handler/puma.rb
CHANGED
@@ -11,10 +11,10 @@ module Rack
|
|
11
11
|
}
|
12
12
|
|
13
13
|
def self.config(app, options = {})
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
require_relative '../../puma'
|
15
|
+
require_relative '../../puma/configuration'
|
16
|
+
require_relative '../../puma/log_writer'
|
17
|
+
require_relative '../../puma/launcher'
|
18
18
|
|
19
19
|
default_options = DEFAULT_OPTIONS.dup
|
20
20
|
|
@@ -63,9 +63,9 @@ module Rack
|
|
63
63
|
def self.run(app, **options)
|
64
64
|
conf = self.config(app, options)
|
65
65
|
|
66
|
-
|
66
|
+
log_writer = options.delete(:Silent) ? ::Puma::LogWriter.strings : ::Puma::LogWriter.stdio
|
67
67
|
|
68
|
-
launcher = ::Puma::Launcher.new(conf, :
|
68
|
+
launcher = ::Puma::Launcher.new(conf, :log_writer => log_writer)
|
69
69
|
|
70
70
|
yield launcher if block_given?
|
71
71
|
begin
|
@@ -93,16 +93,16 @@ module Rack
|
|
93
93
|
config.bind "unix://#{host}"
|
94
94
|
elsif host && host =~ /^ssl:\/\//
|
95
95
|
uri = URI.parse(host)
|
96
|
-
uri.port ||= port || ::Puma::Configuration::
|
96
|
+
uri.port ||= port || ::Puma::Configuration::DEFAULTS[:tcp_port]
|
97
97
|
config.bind uri.to_s
|
98
98
|
else
|
99
99
|
|
100
100
|
if host
|
101
|
-
port ||= ::Puma::Configuration::
|
101
|
+
port ||= ::Puma::Configuration::DEFAULTS[:tcp_port]
|
102
102
|
end
|
103
103
|
|
104
104
|
if port
|
105
|
-
host ||= ::Puma::Configuration::
|
105
|
+
host ||= ::Puma::Configuration::DEFAULTS[:tcp_host]
|
106
106
|
config.port port, host
|
107
107
|
end
|
108
108
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Phoenix
|
@@ -62,6 +62,8 @@ files:
|
|
62
62
|
- docs/signals.md
|
63
63
|
- docs/stats.md
|
64
64
|
- docs/systemd.md
|
65
|
+
- docs/testing_benchmarks_local_files.md
|
66
|
+
- docs/testing_test_rackup_ci_files.md
|
65
67
|
- ext/puma_http11/PumaHttp11Service.java
|
66
68
|
- ext/puma_http11/ext_help.h
|
67
69
|
- ext/puma_http11/extconf.rb
|
@@ -96,12 +98,13 @@ files:
|
|
96
98
|
- lib/puma/jruby_restart.rb
|
97
99
|
- lib/puma/json_serialization.rb
|
98
100
|
- lib/puma/launcher.rb
|
101
|
+
- lib/puma/launcher/bundle_pruner.rb
|
102
|
+
- lib/puma/log_writer.rb
|
99
103
|
- lib/puma/minissl.rb
|
100
104
|
- lib/puma/minissl/context_builder.rb
|
101
105
|
- lib/puma/null_io.rb
|
102
106
|
- lib/puma/plugin.rb
|
103
107
|
- lib/puma/plugin/tmp_restart.rb
|
104
|
-
- lib/puma/queue_close.rb
|
105
108
|
- lib/puma/rack/builder.rb
|
106
109
|
- lib/puma/rack/urlmap.rb
|
107
110
|
- lib/puma/rack_default.rb
|
@@ -125,6 +128,7 @@ metadata:
|
|
125
128
|
changelog_uri: https://github.com/puma/puma/blob/master/History.md
|
126
129
|
homepage_uri: https://puma.io
|
127
130
|
source_code_uri: https://github.com/puma/puma
|
131
|
+
rubygems_mfa_required: 'true'
|
128
132
|
post_install_message:
|
129
133
|
rdoc_options: []
|
130
134
|
require_paths:
|
@@ -133,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
133
137
|
requirements:
|
134
138
|
- - ">="
|
135
139
|
- !ruby/object:Gem::Version
|
136
|
-
version: '2.
|
140
|
+
version: '2.4'
|
137
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
142
|
requirements:
|
139
143
|
- - ">="
|
data/lib/puma/queue_close.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
class ClosedQueueError < StandardError; end
|
2
|
-
module Puma
|
3
|
-
|
4
|
-
# Queue#close was added in Ruby 2.3.
|
5
|
-
# Add a simple implementation for earlier Ruby versions.
|
6
|
-
#
|
7
|
-
module QueueClose
|
8
|
-
def close
|
9
|
-
num_waiting.times {push nil}
|
10
|
-
@closed = true
|
11
|
-
end
|
12
|
-
def closed?
|
13
|
-
@closed ||= false
|
14
|
-
end
|
15
|
-
def push(object)
|
16
|
-
raise ClosedQueueError if closed?
|
17
|
-
super
|
18
|
-
end
|
19
|
-
alias << push
|
20
|
-
def pop(non_block=false)
|
21
|
-
return nil if !non_block && closed? && empty?
|
22
|
-
super
|
23
|
-
end
|
24
|
-
end
|
25
|
-
::Queue.prepend QueueClose
|
26
|
-
end
|