puma 4.2.0-java → 4.2.1-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75119fd1363b02abae04eede7bcdcbe0933df22c0524c3cdbe69ca897aee56ec
4
- data.tar.gz: 932e1937b72c08b5d9db051a60a445c2a23068ccf6dde7f1009aa492aecbb1d5
3
+ metadata.gz: eab8fa50918c4889b6abe601c8b7dd055b7a756ec33102072a3a26a11c489948
4
+ data.tar.gz: a7b3bd761abf7406a6ea762db2e3b9c55e5b1ef829cce4277acd6892d3f824fb
5
5
  SHA512:
6
- metadata.gz: ea9f1a2ccd9a6c0b6de0291275e23caece34c68be8a4a05abb51131bd27ae69cff3bbebfbfc0c8afb2c49a8224e0cda4e666b865d1fa10ad0840b4c9c7289a1e
7
- data.tar.gz: c052cb5e8119624d4a442e7120b006379326795782af7b7b550e45c81ef5955e6728ae52e16a158e928afafb968fd3da8c4e36d5dc9368cb680e3ac638e0e4c9
6
+ metadata.gz: 1a84226a8ab2ec1681ef0283f8237286a5120a0e7719556da71116839c292c65ce58ca2ce3a248fe51ee1d0805efc963d31f6b995f978f26c755b1e2abda66a8
7
+ data.tar.gz: e5aa65bb4f9d500d6a88796d85441056afb1c6e8de3fcd3ffb72105ffd2afaf1ae68e8327d5986368e6f253254eb42c57bba4a64bc5ad9bc37ed4a9bbb5617a8
data/History.md CHANGED
@@ -1,11 +1,15 @@
1
- ## Master
2
-
3
1
  * Features
4
2
  * Your feature goes here (#Github Number)
5
3
 
6
4
  * Bugfixes
7
5
  * Your bugfix goes here (#Github Number)
8
6
 
7
+ ## 4.2.1 / 2019-10-07
8
+
9
+ * 3 bugfixes
10
+ * Fix socket activation of systemd (pre-existing) unix binder files (#1842, #1988)
11
+ * Deal with multiple calls to bind correctly (#1986, #1994, #2006)
12
+ * Accepts symbols for `verify_mode` (#1222)
9
13
 
10
14
  ## 4.2.0 / 2019-09-23
11
15
 
data/README.md CHANGED
@@ -304,6 +304,8 @@ Which can also be used to run a single test case:
304
304
  $ bundle exec m test/test_binder.rb:37
305
305
  ```
306
306
 
307
+ If you open a pull request with a change that doesn't need to be noted in the changelog ([`History.md`](History.md)), add the text `[changelog skip]` to the pull request title to skip [the changelog check](https://github.com/puma/puma/pull/1991).
308
+
307
309
  ## License
308
310
 
309
311
  Puma is copyright Evan Phoenix and contributors, licensed under the BSD 3-Clause license. See the included LICENSE file for details.
data/docs/plugins.md CHANGED
@@ -1,15 +1,22 @@
1
1
  ## Plugins
2
2
 
3
- Puma 3.0 added support for plugins that can augment configuration and service operations.
3
+ Puma 3.0 added support for plugins that can augment configuration and service
4
+ operations.
4
5
 
5
6
  2 canonical plugins to look to aid in development of further plugins:
6
7
 
7
- * [tmp\_restart](https://github.com/puma/puma/blob/master/lib/puma/plugin/tmp_restart.rb): Restarts the server if the file `tmp/restart.txt` is touched
8
- * [heroku](https://github.com/puma/puma-heroku/blob/master/lib/puma/plugin/heroku.rb): Packages up the default configuration used by puma on Heroku
8
+ * [tmp\_restart](https://github.com/puma/puma/blob/master/lib/puma/plugin/tmp_restart.rb):
9
+ Restarts the server if the file `tmp/restart.txt` is touched
10
+ * [heroku](https://github.com/puma/puma-heroku/blob/master/lib/puma/plugin/heroku.rb):
11
+ Packages up the default configuration used by puma on Heroku
9
12
 
10
- Plugins are activated in a puma configuration file (such as `config/puma.rb'`) by adding `plugin "name"`, such as `plugin "heroku"`.
13
+ Plugins are activated in a puma configuration file (such as `config/puma.rb'`)
14
+ by adding `plugin "name"`, such as `plugin "heroku"`.
11
15
 
12
- Plugins are activated based simply on path requirements so, activating the `heroku` plugin will simply be doing `require "puma/plugin/heroku"`. This allows gems to provide multiple plugins (as well as unrelated gems to provide puma plugins).
16
+ Plugins are activated based simply on path requirements so, activating the
17
+ `heroku` plugin will simply be doing `require "puma/plugin/heroku"`. This
18
+ allows gems to provide multiple plugins (as well as unrelated gems to provide
19
+ puma plugins).
13
20
 
14
21
  The `tmp_restart` plugin is bundled with puma, so it can always be used.
15
22
 
@@ -17,12 +24,15 @@ To use the `heroku` plugin, add `puma-heroku` to your Gemfile or install it.
17
24
 
18
25
  ### API
19
26
 
20
- At present, there are 2 hooks that plugins can use: `start` and `config`.
27
+ ## Server-wide hooks
21
28
 
22
- `start` runs when the server has started and allows the plugin to start other functionality to augment puma.
29
+ Plugins can use a couple of hooks at server level: `start` and `config`.
23
30
 
24
- `config` runs when the server is being configured and is passed a `Puma::DSL` object that can be used to add additional configuration.
31
+ `start` runs when the server has started and allows the plugin to start other
32
+ functionality to augment puma.
25
33
 
26
- Any public methods in `Puma::Plugin` are the public API that any plugin may use.
34
+ `config` runs when the server is being configured and is passed a `Puma::DSL`
35
+ object that can be used to add additional configuration.
27
36
 
28
- In the future, more hooks and APIs will be added.
37
+ Any public methods in `Puma::Plugin` are the public API that any plugin may
38
+ use.
data/lib/puma/binder.rb CHANGED
@@ -105,6 +105,7 @@ module Puma
105
105
  io = add_tcp_listener uri.host, uri.port, opt, bak
106
106
 
107
107
  @ios.each do |i|
108
+ next unless TCPServer === i
108
109
  addr = if i.local_address.ipv6?
109
110
  "[#{i.local_address.ip_unpack[0]}]:#{i.local_address.ip_unpack[1]}"
110
111
  else
@@ -360,7 +361,7 @@ module Puma
360
361
  # Tell the server to listen on +path+ as a UNIX domain socket.
361
362
  #
362
363
  def add_unix_listener(path, umask=nil, mode=nil, backlog=1024)
363
- @unix_paths << path
364
+ @unix_paths << path unless File.exist? path
364
365
 
365
366
  # Let anyone connect by default
366
367
  umask ||= 0
@@ -398,7 +399,7 @@ module Puma
398
399
  end
399
400
 
400
401
  def inherit_unix_listener(path, fd)
401
- @unix_paths << path
402
+ @unix_paths << path unless File.exist? path
402
403
 
403
404
  if fd.kind_of? TCPServer
404
405
  s = fd
@@ -419,7 +420,8 @@ module Puma
419
420
  io.close
420
421
  uri = URI.parse(l)
421
422
  next unless uri.scheme == 'unix'
422
- File.unlink("#{uri.host}#{uri.path}")
423
+ unix_path = "#{uri.host}#{uri.path}"
424
+ File.unlink unix_path if @unix_paths.include? unix_path
423
425
  end
424
426
  end
425
427
 
data/lib/puma/client.rb CHANGED
@@ -9,8 +9,8 @@ class IO
9
9
  end
10
10
 
11
11
  require 'puma/detect'
12
- require 'puma/delegation'
13
12
  require 'tempfile'
13
+ require 'forwardable'
14
14
 
15
15
  if Puma::IS_JRUBY
16
16
  # We have to work around some OpenSSL buffer/io-readiness bugs
@@ -41,7 +41,7 @@ module Puma
41
41
  EmptyBody = NullIO.new
42
42
 
43
43
  include Puma::Const
44
- extend Puma::Delegation
44
+ extend Forwardable
45
45
 
46
46
  def initialize(io, env=nil)
47
47
  @io = io
@@ -83,7 +83,7 @@ module Puma
83
83
 
84
84
  attr_accessor :remote_addr_header
85
85
 
86
- forward :closed?, :@io
86
+ def_delegators :@io, :closed?
87
87
 
88
88
  def inspect
89
89
  "#<Puma::Client:0x#{object_id.to_s(16)} @ready=#{@ready.inspect}>"
data/lib/puma/cluster.rb CHANGED
@@ -529,7 +529,6 @@ module Puma
529
529
  @suicide_pipe.close
530
530
  read.close
531
531
  @wakeup.close
532
- @launcher.close_binder_unix_paths
533
532
  end
534
533
  end
535
534
 
data/lib/puma/const.rb CHANGED
@@ -100,7 +100,7 @@ module Puma
100
100
  # too taxing on performance.
101
101
  module Const
102
102
 
103
- PUMA_VERSION = VERSION = "4.2.0".freeze
103
+ PUMA_VERSION = VERSION = "4.2.1".freeze
104
104
  CODE_NAME = "Distant Airhorns".freeze
105
105
  PUMA_SERVER_STRING = ['puma', PUMA_VERSION, CODE_NAME].join(' ').freeze
106
106
 
data/lib/puma/dsl.rb CHANGED
@@ -396,7 +396,7 @@ module Puma
396
396
  # keystore_pass: password
397
397
  # }
398
398
  def ssl_bind(host, port, opts)
399
- verify = opts.fetch(:verify_mode, 'none')
399
+ verify = opts.fetch(:verify_mode, 'none').to_s
400
400
  no_tlsv1 = opts.fetch(:no_tlsv1, 'false')
401
401
  no_tlsv1_1 = opts.fetch(:no_tlsv1_1, 'false')
402
402
  ca_additions = "&ca=#{opts[:ca]}" if ['peer', 'force_peer'].include?(verify)
data/lib/puma/launcher.rb CHANGED
@@ -184,6 +184,7 @@ module Puma
184
184
  when :exit
185
185
  # nothing
186
186
  end
187
+ @binder.close_unix_paths
187
188
  end
188
189
 
189
190
  # Return which tcp port the launcher is using, if it's using TCP
@@ -204,10 +205,6 @@ module Puma
204
205
  @binder.close_listeners
205
206
  end
206
207
 
207
- def close_binder_unix_paths
208
- @binder.close_unix_paths
209
- end
210
-
211
208
  private
212
209
 
213
210
  # If configured, write the pid of the current process out
Binary file
data/lib/puma/server.rb CHANGED
@@ -9,13 +9,13 @@ require 'puma/null_io'
9
9
  require 'puma/reactor'
10
10
  require 'puma/client'
11
11
  require 'puma/binder'
12
- require 'puma/delegation'
13
12
  require 'puma/accept_nonblock'
14
13
  require 'puma/util'
15
14
 
16
15
  require 'puma/puma_http11'
17
16
 
18
17
  require 'socket'
18
+ require 'forwardable'
19
19
 
20
20
  module Puma
21
21
 
@@ -32,7 +32,7 @@ module Puma
32
32
  class Server
33
33
 
34
34
  include Puma::Const
35
- extend Puma::Delegation
35
+ extend Forwardable
36
36
 
37
37
  attr_reader :thread
38
38
  attr_reader :events
@@ -89,10 +89,7 @@ module Puma
89
89
 
90
90
  attr_accessor :binder, :leak_stack_on_error, :early_hints
91
91
 
92
- forward :add_tcp_listener, :@binder
93
- forward :add_ssl_listener, :@binder
94
- forward :add_unix_listener, :@binder
95
- forward :connected_port, :@binder
92
+ def_delegators :@binder, :add_tcp_listener, :add_ssl_listener, :add_unix_listener, :connected_port
96
93
 
97
94
  def inherit_binder(bind)
98
95
  @binder = bind
data/lib/puma/single.rb CHANGED
@@ -118,7 +118,6 @@ module Puma
118
118
  rescue Interrupt
119
119
  # Swallow it
120
120
  end
121
- @launcher.close_binder_unix_paths
122
121
  end
123
122
  end
124
123
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.1
5
5
  platform: java
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-23 00:00:00.000000000 Z
11
+ date: 2019-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -79,7 +79,6 @@ files:
79
79
  - lib/puma/const.rb
80
80
  - lib/puma/control_cli.rb
81
81
  - lib/puma/convenient.rb
82
- - lib/puma/delegation.rb
83
82
  - lib/puma/detect.rb
84
83
  - lib/puma/dsl.rb
85
84
  - lib/puma/events.rb
@@ -136,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
135
  - !ruby/object:Gem::Version
137
136
  version: '0'
138
137
  requirements: []
139
- rubyforge_project:
140
- rubygems_version: 2.7.9
138
+ rubygems_version: 3.0.6
141
139
  signing_key:
142
140
  specification_version: 4
143
141
  summary: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Puma
4
- module Delegation
5
- def forward(what, who)
6
- module_eval <<-CODE
7
- def #{what}(*args, &block)
8
- #{who}.#{what}(*args, &block)
9
- end
10
- CODE
11
- end
12
- end
13
- end