puma 3.12.0-java → 3.12.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
- SHA1:
3
- metadata.gz: 4795399f21449a035ea8c866de8163e73ed905e2
4
- data.tar.gz: d58719b070aa0e1e1fddabad0ed26310a5db84c7
2
+ SHA256:
3
+ metadata.gz: 5806fb34ffd1840cdcdccc3ec1f8193affc6cfc12f6a493801836b529ca1de00
4
+ data.tar.gz: 3499e2b03cc6d19cd60cb38bd3f83adf61d75b8c845ac6ecb8e15c7e511a74b4
5
5
  SHA512:
6
- metadata.gz: c04f751d047c44bd50755018febbb750f63d84db5f6449fccb3a3467ab9608afc6fdebec25a390a2c8e3cb4fcdb567ac32a496b385b5fe06f5917df49cff8ae1
7
- data.tar.gz: 8a9c18e321f7c881235bd35a78ab8cc73e6e7d3bc8ff0dd7cfc6f3442ebe254ec39ae3e8623b8dae74136ce60a3c4f142b2f4161fe1b0e8f36342283a224ca09
6
+ metadata.gz: 160a9538102860ff42d698b5c0e785d7eaaabc51f3c4015a6c3bf20bf169e11357154a8972e345037864553a41da9da098de1a52e7f9a954da16145df45a97fe
7
+ data.tar.gz: 04a399c06144d7826da0263451b34558a28c0ea496b25de4208d36b0b5879535efa890cf849477e4c63afd53d12695d8b8e6213a736f258977f6ce180e5850d7
data/History.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## Master
2
+
3
+ * x features
4
+
5
+ * x bugfixes
6
+
7
+ ## 3.12.1 / 2019-01-08
8
+
9
+ * 1 features
10
+ * Internal strings are frozen (#1649)
11
+ * 3 bugfixes
12
+ * Fix chunked ending check (#1607)
13
+ * Rack handler should use provided default host (#1700)
14
+ * Better support for detecting runtimes that support `fork` (#1630)
15
+
1
16
  ## 3.12.0 / 2018-07-13
2
17
 
3
18
  * 5 features:
@@ -433,6 +433,18 @@ void Init_mini_ssl(VALUE puma) {
433
433
  mod = rb_define_module_under(puma, "MiniSSL");
434
434
  eng = rb_define_class_under(mod, "Engine", rb_cObject);
435
435
 
436
+ // OpenSSL Build / Runtime/Load versions
437
+
438
+ /* Version of OpenSSL that Puma was compiled with */
439
+ rb_define_const(mod, "OPENSSL_VERSION", rb_str_new2(OPENSSL_VERSION_TEXT));
440
+
441
+ #if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000
442
+ /* Version of OpenSSL that Puma loaded with */
443
+ rb_define_const(mod, "OPENSSL_LIBRARY_VERSION", rb_str_new2(OpenSSL_version(OPENSSL_VERSION)));
444
+ #else
445
+ rb_define_const(mod, "OPENSSL_LIBRARY_VERSION", rb_str_new2(SSLeay_version(SSLEAY_VERSION)));
446
+ #endif
447
+
436
448
  rb_define_singleton_method(mod, "check", noop, 0);
437
449
 
438
450
  eError = rb_define_class_under(mod, "SSLError", rb_eStandardError);
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'uri'
2
4
  require 'socket'
3
5
 
@@ -90,19 +92,19 @@ module Puma
90
92
  case uri.scheme
91
93
  when "tcp"
92
94
  if fd = @inherited_fds.delete(str)
93
- logger.log "* Inherited #{str}"
94
95
  io = inherit_tcp_listener uri.host, uri.port, fd
96
+ logger.log "* Inherited #{str}"
95
97
  elsif sock = @activated_sockets.delete([ :tcp, uri.host, uri.port ])
96
- logger.log "* Activated #{str}"
97
98
  io = inherit_tcp_listener uri.host, uri.port, sock
99
+ logger.log "* Activated #{str}"
98
100
  else
99
101
  params = Util.parse_query uri.query
100
102
 
101
103
  opt = params.key?('low_latency')
102
104
  bak = params.fetch('backlog', 1024).to_i
103
105
 
104
- logger.log "* Listening on #{str}"
105
106
  io = add_tcp_listener uri.host, uri.port, opt, bak
107
+ logger.log "* Listening on #{str}"
106
108
  end
107
109
 
108
110
  @listeners << [str, io] if io
@@ -110,14 +112,12 @@ module Puma
110
112
  path = "#{uri.host}#{uri.path}".gsub("%20", " ")
111
113
 
112
114
  if fd = @inherited_fds.delete(str)
113
- logger.log "* Inherited #{str}"
114
115
  io = inherit_unix_listener path, fd
116
+ logger.log "* Inherited #{str}"
115
117
  elsif sock = @activated_sockets.delete([ :unix, path ])
116
- logger.log "* Activated #{str}"
117
118
  io = inherit_unix_listener path, sock
119
+ logger.log "* Activated #{str}"
118
120
  else
119
- logger.log "* Listening on #{str}"
120
-
121
121
  umask = nil
122
122
  mode = nil
123
123
  backlog = 1024
@@ -139,6 +139,7 @@ module Puma
139
139
  end
140
140
 
141
141
  io = add_unix_listener path, umask, mode, backlog
142
+ logger.log "* Listening on #{str}"
142
143
  end
143
144
 
144
145
  @listeners << [str, io]
@@ -204,11 +205,11 @@ module Puma
204
205
  logger.log "* Inherited #{str}"
205
206
  io = inherit_ssl_listener fd, ctx
206
207
  elsif sock = @activated_sockets.delete([ :tcp, uri.host, uri.port ])
207
- logger.log "* Activated #{str}"
208
208
  io = inherit_ssl_listener sock, ctx
209
+ logger.log "* Activated #{str}"
209
210
  else
210
- logger.log "* Listening on #{str}"
211
211
  io = add_ssl_listener uri.host, uri.port, ctx
212
+ logger.log "* Listening on #{str}"
212
213
  end
213
214
 
214
215
  @listeners << [str, io] if io
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'optparse'
2
4
  require 'uri'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class IO
2
4
  # We need to use this for a jruby work around on both 1.8 and 1.9.
3
5
  # So this either creates the constant (on 1.8), or harmlessly
@@ -168,6 +170,7 @@ module Puma
168
170
  if len == 0
169
171
  @body.rewind
170
172
  rest = io.read
173
+ rest = rest[2..-1] if rest.start_with?("\r\n")
171
174
  @buffer = rest.empty? ? nil : rest
172
175
  @requests_served += 1
173
176
  @ready = true
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puma/runner'
2
4
  require 'puma/util'
3
5
  require 'puma/plugin'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Puma
2
4
  # Rack::CommonLogger forwards every request to the given +app+, and
3
5
  # logs a line in the
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puma/rack/builder'
2
4
  require 'puma/plugin'
3
5
  require 'puma/const'
@@ -1,4 +1,6 @@
1
1
  #encoding: utf-8
2
+ # frozen_string_literal: true
3
+
2
4
  module Puma
3
5
  class UnsupportedOption < RuntimeError
4
6
  end
@@ -98,7 +100,7 @@ module Puma
98
100
  # too taxing on performance.
99
101
  module Const
100
102
 
101
- PUMA_VERSION = VERSION = "3.12.0".freeze
103
+ PUMA_VERSION = VERSION = "3.12.1".freeze
102
104
  CODE_NAME = "Llamas in Pajamas".freeze
103
105
  PUMA_SERVER_STRING = ['puma', PUMA_VERSION, CODE_NAME].join(' ').freeze
104
106
 
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'optparse'
2
- require 'puma/state_file'
3
- require 'puma/const'
4
- require 'puma/detect'
5
- require 'puma/configuration'
4
+ require_relative 'state_file'
5
+ require_relative 'const'
6
+ require_relative 'detect'
7
+ require_relative 'configuration'
6
8
  require 'uri'
7
9
  require 'socket'
8
10
 
@@ -129,7 +131,7 @@ module Puma
129
131
  uri = URI.parse @control_url
130
132
 
131
133
  # create server object by scheme
132
- @server = case uri.scheme
134
+ server = case uri.scheme
133
135
  when "tcp"
134
136
  TCPSocket.new uri.host, uri.port
135
137
  when "unix"
@@ -147,9 +149,9 @@ module Puma
147
149
  url = url + "?token=#{@control_auth_token}"
148
150
  end
149
151
 
150
- @server << "GET #{url} HTTP/1.0\r\n\r\n"
152
+ server << "GET #{url} HTTP/1.0\r\n\r\n"
151
153
 
152
- unless data = @server.read
154
+ unless data = server.read
153
155
  raise "Server closed connection before responding"
154
156
  end
155
157
 
@@ -172,8 +174,8 @@ module Puma
172
174
  message "Command #{@command} sent success"
173
175
  message response.last if @command == "stats" || @command == "gc-stats"
174
176
  end
175
-
176
- @server.close
177
+ ensure
178
+ server.close if server && !server.closed?
177
179
  end
178
180
 
179
181
  def send_signal
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puma/launcher'
2
4
  require 'puma/configuration'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Process
2
4
 
3
5
  # This overrides the default version because it is broken if it
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Puma
2
4
  module Delegation
3
5
  def forward(what, who)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Puma
2
4
  IS_JRUBY = defined?(JRUBY_VERSION)
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Puma
2
4
  # The methods that are available for use inside the config file.
3
5
  # These same methods are used in Puma cli and the rack handler
@@ -55,6 +57,14 @@ module Puma
55
57
  @plugins.clear
56
58
  end
57
59
 
60
+ def set_default_host(host)
61
+ @options[:default_host] = host
62
+ end
63
+
64
+ def default_host
65
+ @options[:default_host] || Configuration::DefaultTCPHost
66
+ end
67
+
58
68
  def inject(&blk)
59
69
  instance_eval(&blk)
60
70
  end
@@ -138,7 +148,7 @@ module Puma
138
148
  # Define the TCP port to bind to. Use +bind+ for more advanced options.
139
149
  #
140
150
  def port(port, host=nil)
141
- host ||= Configuration::DefaultTCPHost
151
+ host ||= default_host
142
152
  bind "tcp://#{host}:#{port}"
143
153
  end
144
154
 
@@ -493,7 +503,7 @@ module Puma
493
503
  when Hash
494
504
  if hdr = val[:header]
495
505
  @options[:remote_address] = :header
496
- @options[:remote_address_header] = "HTTP_" + hdr.upcase.gsub("-", "_")
506
+ @options[:remote_address_header] = "HTTP_" + hdr.upcase.tr("-", "_")
497
507
  else
498
508
  raise "Invalid value for set_remote_address - #{val.inspect}"
499
509
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puma/const'
2
4
  require "puma/null_io"
3
5
  require 'stringio'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puma/detect'
2
4
 
3
5
  if Puma.jruby?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'java'
2
4
 
3
5
  # Conservative native JRuby/Java implementation of IOBuffer
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ffi'
2
4
 
3
5
  module Puma
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puma/events'
2
4
  require 'puma/detect'
3
5
 
@@ -63,8 +65,8 @@ module Puma
63
65
 
64
66
  generate_restart_data
65
67
 
66
- if clustered? && (Puma.jruby? || Puma.windows?)
67
- unsupported 'worker mode not supported on JRuby or Windows'
68
+ if clustered? && !Process.respond_to?(:fork)
69
+ unsupported "worker mode not supported on #{RUBY_ENGINE} on this platform"
68
70
  end
69
71
 
70
72
  if @options[:daemon] && Puma.windows?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require 'io/wait'
3
5
  rescue LoadError
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Puma
2
4
  # Provides an IO-like object that always appears to contain no data.
3
5
  # Used as the value for rack.input when the request has no body.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Puma
2
4
  class UnknownPlugin < RuntimeError; end
3
5
 
Binary file
@@ -110,7 +110,8 @@ module Puma::Rack
110
110
 
111
111
  has_options = false
112
112
  server.valid_options.each do |name, description|
113
- next if name.to_s.match(/^(Host|Port)[^a-zA-Z]/) # ignore handler's host and port options, we do our own.
113
+ next if name.to_s =~ /^(Host|Port)[^a-zA-Z]/ # ignore handler's host and port options, we do our own.
114
+
114
115
  info << " -O %-21s %s" % [name, description]
115
116
  has_options = true
116
117
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puma/util'
2
4
  require 'puma/minissl'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puma/server'
2
4
  require 'puma/const'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'stringio'
2
4
 
3
5
  require 'puma/thread_pool'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puma/runner'
2
4
  require 'puma/detect'
3
5
  require 'puma/plugin'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  module Puma
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Puma
2
4
  class TCPLogger
3
5
  def initialize(logger, app, quiet=false)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'thread'
2
4
 
3
5
  module Puma
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  major, minor, patch = RUBY_VERSION.split('.').map { |v| v.to_i }
2
3
 
3
4
  if major == 1 && minor == 9 && patch == 3 && RUBY_PATCHLEVEL < 125
@@ -49,6 +49,9 @@ module Rack
49
49
  self.set_host_port_to_config(host, port, user_config)
50
50
  end
51
51
 
52
+ if default_options[:Host]
53
+ file_config.set_default_host(default_options[:Host])
54
+ end
52
55
  self.set_host_port_to_config(default_options[:Host], default_options[:Port], default_config)
53
56
 
54
57
  user_config.app app
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: 3.12.0
4
+ version: 3.12.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: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2019-03-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server
14
14
  for Ruby/Rack applications. Puma is intended for use in both development and production
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.6.14.1
127
+ rubygems_version: 2.7.6
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for