puma 5.1.1-java → 5.2.0-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 +4 -4
- data/History.md +46 -11
- data/README.md +23 -1
- data/docs/compile_options.md +6 -6
- data/docs/deployment.md +1 -1
- data/docs/kubernetes.md +66 -0
- data/docs/plugins.md +1 -1
- data/docs/stats.md +142 -0
- data/ext/puma_http11/extconf.rb +14 -0
- data/ext/puma_http11/http11_parser.c +19 -21
- data/ext/puma_http11/http11_parser.java.rl +1 -1
- data/ext/puma_http11/http11_parser.rl +1 -1
- data/ext/puma_http11/mini_ssl.c +162 -84
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +5 -7
- data/ext/puma_http11/puma_http11.c +2 -2
- data/lib/puma/binder.rb +23 -24
- data/lib/puma/configuration.rb +2 -1
- data/lib/puma/const.rb +2 -2
- data/lib/puma/control_cli.rb +2 -0
- data/lib/puma/dsl.rb +34 -4
- data/lib/puma/error_logger.rb +10 -3
- data/lib/puma/events.rb +2 -3
- data/lib/puma/launcher.rb +4 -3
- data/lib/puma/minissl.rb +47 -16
- data/lib/puma/minissl/context_builder.rb +6 -0
- data/lib/puma/null_io.rb +4 -0
- data/lib/puma/puma_http11.jar +0 -0
- data/lib/puma/reactor.rb +7 -2
- data/lib/puma/runner.rb +3 -3
- data/lib/puma/server.rb +9 -64
- metadata +4 -2
@@ -62,6 +62,12 @@ module Puma
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
+
if params['verification_flags']
|
66
|
+
ctx.verification_flags = params['verification_flags'].split(',').
|
67
|
+
map { |flag| MiniSSL::VERIFICATION_FLAGS.fetch(flag) }.
|
68
|
+
inject { |sum, flag| sum ? sum | flag : flag }
|
69
|
+
end
|
70
|
+
|
65
71
|
ctx
|
66
72
|
end
|
67
73
|
|
data/lib/puma/null_io.rb
CHANGED
data/lib/puma/puma_http11.jar
CHANGED
Binary file
|
data/lib/puma/reactor.rb
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
require 'puma/queue_close' unless ::Queue.instance_methods.include? :close
|
4
4
|
|
5
5
|
module Puma
|
6
|
+
class UnsupportedBackend < StandardError; end
|
7
|
+
|
6
8
|
# Monitors a collection of IO objects, calling a block whenever
|
7
9
|
# any monitored object either receives data or times out, or when the Reactor shuts down.
|
8
10
|
#
|
@@ -18,9 +20,12 @@ module Puma
|
|
18
20
|
# Create a new Reactor to monitor IO objects added by #add.
|
19
21
|
# The provided block will be invoked when an IO has data available to read,
|
20
22
|
# its timeout elapses, or when the Reactor shuts down.
|
21
|
-
def initialize(&block)
|
23
|
+
def initialize(backend, &block)
|
22
24
|
require 'nio'
|
23
|
-
|
25
|
+
unless backend == :auto || NIO::Selector.backends.include?(backend)
|
26
|
+
raise "unsupported IO selector backend: #{backend} (available backends: #{NIO::Selector.backends.join(', ')})"
|
27
|
+
end
|
28
|
+
@selector = backend == :auto ? NIO::Selector.new : NIO::Selector.new(backend)
|
24
29
|
@input = Queue.new
|
25
30
|
@timeouts = []
|
26
31
|
@block = block
|
data/lib/puma/runner.rb
CHANGED
@@ -55,7 +55,7 @@ module Puma
|
|
55
55
|
app = Puma::App::Status.new @launcher, token
|
56
56
|
|
57
57
|
control = Puma::Server.new app, @launcher.events,
|
58
|
-
{ min_threads: 0, max_threads: 1 }
|
58
|
+
{ min_threads: 0, max_threads: 1, queue_requests: false }
|
59
59
|
|
60
60
|
control.binder.parse [str], self, 'Starting control server'
|
61
61
|
|
@@ -113,8 +113,8 @@ module Puma
|
|
113
113
|
end
|
114
114
|
|
115
115
|
STDOUT.reopen stdout, (append ? "a" : "w")
|
116
|
-
STDOUT.sync = true
|
117
116
|
STDOUT.puts "=== puma startup: #{Time.now} ==="
|
117
|
+
STDOUT.flush unless STDOUT.sync
|
118
118
|
end
|
119
119
|
|
120
120
|
if stderr
|
@@ -123,8 +123,8 @@ module Puma
|
|
123
123
|
end
|
124
124
|
|
125
125
|
STDERR.reopen stderr, (append ? "a" : "w")
|
126
|
-
STDERR.sync = true
|
127
126
|
STDERR.puts "=== puma startup: #{Time.now} ==="
|
127
|
+
STDERR.flush unless STDERR.sync
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
data/lib/puma/server.rb
CHANGED
@@ -84,13 +84,14 @@ module Puma
|
|
84
84
|
|
85
85
|
@options = options
|
86
86
|
|
87
|
-
@early_hints
|
88
|
-
@first_data_timeout
|
89
|
-
@min_threads
|
90
|
-
@max_threads
|
91
|
-
@persistent_timeout
|
92
|
-
@queue_requests
|
93
|
-
@max_fast_inline
|
87
|
+
@early_hints = options.fetch :early_hints, nil
|
88
|
+
@first_data_timeout = options.fetch :first_data_timeout, FIRST_DATA_TIMEOUT
|
89
|
+
@min_threads = options.fetch :min_threads, 0
|
90
|
+
@max_threads = options.fetch :max_threads , (Puma.mri? ? 5 : 16)
|
91
|
+
@persistent_timeout = options.fetch :persistent_timeout, PERSISTENT_TIMEOUT
|
92
|
+
@queue_requests = options.fetch :queue_requests, true
|
93
|
+
@max_fast_inline = options.fetch :max_fast_inline, MAX_FAST_INLINE
|
94
|
+
@io_selector_backend = options.fetch :io_selector_backend, :auto
|
94
95
|
|
95
96
|
temp = !!(@options[:environment] =~ /\A(development|test)\z/)
|
96
97
|
@leak_stack_on_error = @options[:environment] ? temp : true
|
@@ -237,7 +238,7 @@ module Puma
|
|
237
238
|
@thread_pool.clean_thread_locals = @options[:clean_thread_locals]
|
238
239
|
|
239
240
|
if @queue_requests
|
240
|
-
@reactor = Reactor.new(&method(:reactor_wakeup))
|
241
|
+
@reactor = Reactor.new(@io_selector_backend, &method(:reactor_wakeup))
|
241
242
|
@reactor.run
|
242
243
|
end
|
243
244
|
|
@@ -494,62 +495,6 @@ module Puma
|
|
494
495
|
|
495
496
|
# :nocov:
|
496
497
|
|
497
|
-
# Given the request +env+ from +client+ and the partial body +body+
|
498
|
-
# plus a potential Content-Length value +cl+, finish reading
|
499
|
-
# the body and return it.
|
500
|
-
#
|
501
|
-
# If the body is larger than MAX_BODY, a Tempfile object is used
|
502
|
-
# for the body, otherwise a StringIO is used.
|
503
|
-
# @deprecated 6.0.0
|
504
|
-
#
|
505
|
-
def read_body(env, client, body, cl)
|
506
|
-
content_length = cl.to_i
|
507
|
-
|
508
|
-
remain = content_length - body.bytesize
|
509
|
-
|
510
|
-
return StringIO.new(body) if remain <= 0
|
511
|
-
|
512
|
-
# Use a Tempfile if there is a lot of data left
|
513
|
-
if remain > MAX_BODY
|
514
|
-
stream = Tempfile.new(Const::PUMA_TMP_BASE)
|
515
|
-
stream.binmode
|
516
|
-
else
|
517
|
-
# The body[0,0] trick is to get an empty string in the same
|
518
|
-
# encoding as body.
|
519
|
-
stream = StringIO.new body[0,0]
|
520
|
-
end
|
521
|
-
|
522
|
-
stream.write body
|
523
|
-
|
524
|
-
# Read an odd sized chunk so we can read even sized ones
|
525
|
-
# after this
|
526
|
-
chunk = client.readpartial(remain % CHUNK_SIZE)
|
527
|
-
|
528
|
-
# No chunk means a closed socket
|
529
|
-
unless chunk
|
530
|
-
stream.close
|
531
|
-
return nil
|
532
|
-
end
|
533
|
-
|
534
|
-
remain -= stream.write(chunk)
|
535
|
-
|
536
|
-
# Read the rest of the chunks
|
537
|
-
while remain > 0
|
538
|
-
chunk = client.readpartial(CHUNK_SIZE)
|
539
|
-
unless chunk
|
540
|
-
stream.close
|
541
|
-
return nil
|
542
|
-
end
|
543
|
-
|
544
|
-
remain -= stream.write(chunk)
|
545
|
-
end
|
546
|
-
|
547
|
-
stream.rewind
|
548
|
-
|
549
|
-
return stream
|
550
|
-
end
|
551
|
-
# :nocov:
|
552
|
-
|
553
498
|
# Handle various error types thrown by Client I/O operations.
|
554
499
|
def client_error(e, client)
|
555
500
|
# Swallow, do not log
|
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: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Evan Phoenix
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,10 +53,12 @@ files:
|
|
53
53
|
- docs/jungle/rc.d/README.md
|
54
54
|
- docs/jungle/rc.d/puma
|
55
55
|
- docs/jungle/rc.d/puma.conf
|
56
|
+
- docs/kubernetes.md
|
56
57
|
- docs/nginx.md
|
57
58
|
- docs/plugins.md
|
58
59
|
- docs/restart.md
|
59
60
|
- docs/signals.md
|
61
|
+
- docs/stats.md
|
60
62
|
- docs/systemd.md
|
61
63
|
- ext/puma_http11/PumaHttp11Service.java
|
62
64
|
- ext/puma_http11/ext_help.h
|