puma 2.13.4 → 2.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6d1f76be9cff6f4869f548f8a79ffd38f7aca1e
4
- data.tar.gz: 9b9f96f22bddf25bda4781383ae1a27de6c14d79
3
+ metadata.gz: a1906e2cec23c83e7ed5a2e8fb54885809c8bfa1
4
+ data.tar.gz: 8cd1fb3dc9caeb4fe4aa4be995e746beebdaa4d0
5
5
  SHA512:
6
- metadata.gz: 1cbeaf17fc7745c596966329be4d8b49b0b350764102cf59a11f7d921309c2372803183da84ee55acbd1e2682193b0bef6c933b73ccfaf75a04b0200adc71851
7
- data.tar.gz: e0e9447ad29dd98c3bef95080ec873ba28238b0a54dc1c2ec2639dbdae7029f59bd302cfabb893d2649126b3bb34a6616402b927a49ada0967bd58f1c6a248ae
6
+ metadata.gz: 74e867dea23de7b4743d810a29925eba7fbb2d4f674e7c9035985699dc35712d80591ea0b3b25a48b72d550f2550c42303719438c65b341e7b4d649af82b07ca
7
+ data.tar.gz: aa8af24acdcda63f9a8ebfe2ebc573dd048f6e408954125144cf424abfc990baa451b8f6c7197ed015ff30ed2b6d110d96b9c34f67312d8076726b0c278d1c5b
data/History.txt CHANGED
@@ -1,3 +1,11 @@
1
+ === 2.14.0 / 2015-09-18
2
+
3
+ * 1 minor feature:
4
+ * Make building with SSL support optional
5
+
6
+ * 1 bug fix:
7
+ * Use Rack::Builder if available. Fixes #735
8
+
1
9
  === 2.13.4 / 2015-08-16
2
10
 
3
11
  * 1 bug fix:
@@ -2,8 +2,12 @@ require 'mkmf'
2
2
 
3
3
  dir_config("puma_http11")
4
4
 
5
- if %w'crypto libeay32'.find {|crypto| have_library(crypto, 'BIO_read')} and
6
- %w'ssl ssleay32'.find {|ssl| have_library(ssl, 'SSL_CTX_new')}
7
-
8
- create_makefile("puma/puma_http11")
5
+ unless ENV["DISABLE_SSL"]
6
+ if %w'crypto libeay32'.find {|crypto| have_library(crypto, 'BIO_read')} and
7
+ %w'ssl ssleay32'.find {|ssl| have_library(ssl, 'SSL_CTX_new')}
8
+
9
+ have_header "openssl/bio.h"
10
+ end
9
11
  end
12
+
13
+ create_makefile("puma/puma_http11")
@@ -1,6 +1,10 @@
1
1
  #define RSTRING_NOT_MODIFIED 1
2
+
2
3
  #include <ruby.h>
3
4
  #include <rubyio.h>
5
+
6
+ #ifdef HAVE_OPENSSL_BIO_H
7
+
4
8
  #include <openssl/bio.h>
5
9
  #include <openssl/ssl.h>
6
10
  #include <openssl/dh.h>
@@ -347,6 +351,10 @@ VALUE engine_peercert(VALUE self) {
347
351
  return rb_cert_buf;
348
352
  }
349
353
 
354
+ VALUE noop(VALUE self) {
355
+ return Qnil;
356
+ }
357
+
350
358
  void Init_mini_ssl(VALUE puma) {
351
359
  VALUE mod, eng;
352
360
 
@@ -358,6 +366,8 @@ void Init_mini_ssl(VALUE puma) {
358
366
  mod = rb_define_module_under(puma, "MiniSSL");
359
367
  eng = rb_define_class_under(mod, "Engine", rb_cObject);
360
368
 
369
+ rb_define_singleton_method(mod, "check", noop, 0);
370
+
361
371
  eError = rb_define_class_under(mod, "SSLError", rb_eStandardError);
362
372
 
363
373
  rb_define_singleton_method(eng, "server", engine_init_server, 1);
@@ -371,3 +381,20 @@ void Init_mini_ssl(VALUE puma) {
371
381
 
372
382
  rb_define_method(eng, "peercert", engine_peercert, 0);
373
383
  }
384
+
385
+ #else
386
+
387
+ VALUE raise_error(VALUE self) {
388
+ rb_raise(rb_eStandardError, "SSL not available in this build");
389
+ return Qnil;
390
+ }
391
+
392
+ void Init_mini_ssl(VALUE puma) {
393
+ VALUE mod, eng;
394
+
395
+ mod = rb_define_module_under(puma, "MiniSSL");
396
+ rb_define_class_under(mod, "SSLError", rb_eStandardError);
397
+
398
+ rb_define_singleton_method(mod, "check", raise_error, 0);
399
+ }
400
+ #endif
data/lib/puma/binder.rb CHANGED
@@ -128,6 +128,8 @@ module Puma
128
128
 
129
129
  @listeners << [str, io]
130
130
  when "ssl"
131
+ MiniSSL.check
132
+
131
133
  params = Util.parse_query uri.query
132
134
  require 'puma/minissl'
133
135
 
@@ -253,6 +255,8 @@ module Puma
253
255
  optimize_for_latency=true, backlog=1024)
254
256
  require 'puma/minissl'
255
257
 
258
+ MiniSSL.check
259
+
256
260
  host = host[1..-2] if host[0..0] == '['
257
261
  s = TCPServer.new(host, port)
258
262
  if optimize_for_latency
@@ -272,6 +276,8 @@ module Puma
272
276
 
273
277
  def inherited_ssl_listener(fd, ctx)
274
278
  require 'puma/minissl'
279
+ MiniSSL.check
280
+
275
281
  s = TCPServer.for_fd(fd)
276
282
  ssl = MiniSSL::Server.new(s, ctx)
277
283
 
@@ -123,10 +123,24 @@ module Puma
123
123
  File.basename(Dir.getwd)
124
124
  end
125
125
 
126
+ # Load and use the normal Rack builder if we can, otherwise
127
+ # fallback to our minimal version.
128
+ def rack_builder
129
+ begin
130
+ require 'rack'
131
+ require 'rack/builder'
132
+ rescue LoadError
133
+ # ok, use builtin version
134
+ return Puma::Rack::Builder
135
+ else
136
+ return ::Rack::Builder
137
+ end
138
+ end
139
+
126
140
  def load_rackup
127
141
  raise "Missing rackup file '#{rackup}'" unless File.exist?(rackup)
128
142
 
129
- rack_app, rack_options = Puma::Rack::Builder.parse_file(rackup)
143
+ rack_app, rack_options = rack_builder.parse_file(rackup)
130
144
  @options.merge!(rack_options)
131
145
 
132
146
  config_ru_binds = []
data/lib/puma/const.rb CHANGED
@@ -99,8 +99,8 @@ module Puma
99
99
  # too taxing on performance.
100
100
  module Const
101
101
 
102
- PUMA_VERSION = VERSION = "2.13.4".freeze
103
- CODE_NAME = "A Midsummer Code's Dream".freeze
102
+ PUMA_VERSION = VERSION = "2.14.0".freeze
103
+ CODE_NAME = "Fuchsia Friday".freeze
104
104
 
105
105
  FAST_TRACK_KA_TIMEOUT = 0.2
106
106
 
data/lib/puma/minissl.rb CHANGED
@@ -102,6 +102,8 @@ module Puma
102
102
  class SSLError < StandardError
103
103
  # Define this for jruby even though it isn't used.
104
104
  end
105
+
106
+ def self.check; end
105
107
  end
106
108
 
107
109
  class Context
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: 2.13.4
4
+ version: 2.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-16 00:00:00.000000000 Z
11
+ date: 2015-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '3.13'
67
+ version: '3.14'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '3.13'
74
+ version: '3.14'
75
75
  description: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server
76
76
  for Ruby/Rack applications. Puma is intended for use in both development and production
77
77
  environments. In order to get the best throughput, it is highly recommended that