puma 2.12.0-java → 2.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 +4 -4
- data/History.txt +16 -4
- data/README.md +1 -1
- data/ext/puma_http11/mini_ssl.c +2 -3
- data/lib/puma/const.rb +1 -1
- data/lib/puma/events.rb +3 -3
- data/lib/puma/puma_http11.jar +0 -0
- data/lib/puma/server.rb +1 -1
- metadata +5 -41
- data/test/test_app_status.rb +0 -92
- data/test/test_cli.rb +0 -173
- data/test/test_config.rb +0 -62
- data/test/test_http10.rb +0 -27
- data/test/test_http11.rb +0 -144
- data/test/test_integration.rb +0 -206
- data/test/test_iobuffer.rb +0 -38
- data/test/test_minissl.rb +0 -29
- data/test/test_null_io.rb +0 -31
- data/test/test_persistent.rb +0 -238
- data/test/test_puma_server.rb +0 -423
- data/test/test_puma_server_ssl.rb +0 -198
- data/test/test_rack_handler.rb +0 -10
- data/test/test_rack_server.rb +0 -140
- data/test/test_tcp_rack.rb +0 -42
- data/test/test_thread_pool.rb +0 -229
- data/test/test_unix_socket.rb +0 -39
- data/test/test_ws.rb +0 -89
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dc44ef6aaeda70b87da03a15bd5b9bd3abd35d6
|
4
|
+
data.tar.gz: 64d3be4eb9cbffa1e417c29d561553e2198dcb17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d3e867cae3b8c665ae63153d5a47b77f9457f81461976abe27bd9cb82902ba1e68203f8ac4f3dcc3ac7002583f9dc2609b5fce32751f3a85e73f7dd8459591c
|
7
|
+
data.tar.gz: 2d131676d9f81752d5e47af4d643b5e2a5e7ff4c38db02a1e5fa2f9edb27e36c2c725ae38571316bd6ebeae319960846b295a9cd230caff6521f51b80372e112
|
data/History.txt
CHANGED
@@ -1,6 +1,18 @@
|
|
1
|
+
=== 2.12.1 / 2015-07-16
|
2
|
+
|
3
|
+
* 2 bug fixes:
|
4
|
+
* Use a constant format. Fixes #737
|
5
|
+
* Use strerror for Windows sake. Fixes #733
|
6
|
+
|
7
|
+
* 1 doc change:
|
8
|
+
* typo fix: occured -> occurred
|
9
|
+
|
10
|
+
* 1 PR merged:
|
11
|
+
* Merge pull request #736 from paulanunda/paulanunda/typo-fix
|
12
|
+
|
1
13
|
=== 2.12.0 / 2015-07-14
|
2
14
|
|
3
|
-
*
|
15
|
+
* 13 bug fixes:
|
4
16
|
* Add thread reaping to thread pool
|
5
17
|
* Do not automatically use chunked responses when hijacked
|
6
18
|
* Do not suppress Content-Length on partial hijack
|
@@ -15,7 +27,7 @@
|
|
15
27
|
* Remove the default Content-Type: text/plain
|
16
28
|
* Add Client Side Certificate Auth
|
17
29
|
|
18
|
-
*
|
30
|
+
* 8 doc/test changes:
|
19
31
|
* Added example sourcing of environment vars
|
20
32
|
* Added tests for bind configuration on rackup file
|
21
33
|
* Fix example config text
|
@@ -25,11 +37,11 @@
|
|
25
37
|
* ci: Start running tests against JRuby 9k on Travis
|
26
38
|
* ci: Convert to container infrastructure for travisci
|
27
39
|
|
28
|
-
*
|
40
|
+
* 2 ops changes:
|
29
41
|
* Check for system-wide rbenv
|
30
42
|
* capistrano: Add additional env when start rails
|
31
43
|
|
32
|
-
*
|
44
|
+
* 16 PRs merged:
|
33
45
|
* Merge pull request #686 from jjb/patch-2
|
34
46
|
* Merge pull request #693 from rob-murray/update-example-config
|
35
47
|
* Merge pull request #697 from spk/tests-bind-on-rackup-file
|
data/README.md
CHANGED
@@ -131,7 +131,7 @@ error-tracking service (in this example, [rollbar](http://rollbar.com)):
|
|
131
131
|
```ruby
|
132
132
|
lowlevel_error_handler do |e|
|
133
133
|
Rollbar.critical(e)
|
134
|
-
[500, {}, ["An error has
|
134
|
+
[500, {}, ["An error has occurred, and engineers have been informed. Please reload the page. If you continue to have problems, contact support@example.com\n"]]
|
135
135
|
end
|
136
136
|
```
|
137
137
|
|
data/ext/puma_http11/mini_ssl.c
CHANGED
@@ -212,8 +212,7 @@ void raise_error(SSL* ssl, int result) {
|
|
212
212
|
int verify_err = SSL_get_verify_result(ssl);
|
213
213
|
|
214
214
|
if(SSL_ERROR_SYSCALL == ssl_err) {
|
215
|
-
|
216
|
-
snprintf(msg, sizeof(msg), "System error: %s - %d", buf, err);
|
215
|
+
snprintf(msg, sizeof(msg), "System error: %s - %d", strerror(err), err);
|
217
216
|
|
218
217
|
} else if(SSL_ERROR_SSL == ssl_err) {
|
219
218
|
if(X509_V_OK != verify_err) {
|
@@ -233,7 +232,7 @@ void raise_error(SSL* ssl, int result) {
|
|
233
232
|
}
|
234
233
|
|
235
234
|
ERR_clear_error();
|
236
|
-
rb_raise(eError, msg);
|
235
|
+
rb_raise(eError, "%s", msg);
|
237
236
|
}
|
238
237
|
|
239
238
|
VALUE engine_read(VALUE self) {
|
data/lib/puma/const.rb
CHANGED
data/lib/puma/events.rb
CHANGED
@@ -87,7 +87,7 @@ module Puma
|
|
87
87
|
formatter.call(str)
|
88
88
|
end
|
89
89
|
|
90
|
-
# An HTTP parse error has
|
90
|
+
# An HTTP parse error has occurred.
|
91
91
|
# +server+ is the Server object, +env+ the request, and +error+ a
|
92
92
|
# parsing exception.
|
93
93
|
#
|
@@ -96,7 +96,7 @@ module Puma
|
|
96
96
|
@stderr.puts "#{Time.now}: ENV: #{env.inspect}\n---\n"
|
97
97
|
end
|
98
98
|
|
99
|
-
# An SSL error has
|
99
|
+
# An SSL error has occurred.
|
100
100
|
# +server+ is the Server object, +peeraddr+ peer address, +peercert+
|
101
101
|
# any peer certificate (if present), and +error+ an exception object.
|
102
102
|
#
|
@@ -105,7 +105,7 @@ module Puma
|
|
105
105
|
@stderr.puts "#{Time.now}: SSL error, peer: #{peeraddr}, peer cert: #{subject}, #{error.inspect}"
|
106
106
|
end
|
107
107
|
|
108
|
-
# An unknown error has
|
108
|
+
# An unknown error has occurred.
|
109
109
|
# +server+ is the Server object, +env+ the request, +error+ an exception
|
110
110
|
# object, and +kind+ some additional info.
|
111
111
|
#
|
data/lib/puma/puma_http11.jar
CHANGED
Binary file
|
data/lib/puma/server.rb
CHANGED
@@ -764,7 +764,7 @@ module Puma
|
|
764
764
|
if @leak_stack_on_error
|
765
765
|
[500, {}, ["Puma caught this error: #{e.message} (#{e.class})\n#{e.backtrace.join("\n")}"]]
|
766
766
|
else
|
767
|
-
[500, {}, ["An unhandled lowlevel error
|
767
|
+
[500, {}, ["An unhandled lowlevel error occurred. The application logs may have details.\n"]]
|
768
768
|
end
|
769
769
|
end
|
770
770
|
|
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.12.
|
4
|
+
version: 2.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: 2015-07-
|
11
|
+
date: 2015-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -63,7 +63,7 @@ dependencies:
|
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '3.
|
66
|
+
version: '3.13'
|
67
67
|
name: hoe
|
68
68
|
prerelease: false
|
69
69
|
type: :development
|
@@ -71,7 +71,7 @@ dependencies:
|
|
71
71
|
requirements:
|
72
72
|
- - ~>
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '3.
|
74
|
+
version: '3.13'
|
75
75
|
description: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications. Puma is intended for use in both development and production environments. In order to get the best throughput, it is highly recommended that you use a Ruby implementation with real threads like Rubinius or JRuby.
|
76
76
|
email:
|
77
77
|
- evan@phx.io
|
@@ -164,24 +164,6 @@ files:
|
|
164
164
|
- tools/jungle/upstart/puma-manager.conf
|
165
165
|
- tools/jungle/upstart/puma.conf
|
166
166
|
- tools/trickletest.rb
|
167
|
-
- test/test_app_status.rb
|
168
|
-
- test/test_cli.rb
|
169
|
-
- test/test_config.rb
|
170
|
-
- test/test_http10.rb
|
171
|
-
- test/test_http11.rb
|
172
|
-
- test/test_integration.rb
|
173
|
-
- test/test_iobuffer.rb
|
174
|
-
- test/test_minissl.rb
|
175
|
-
- test/test_null_io.rb
|
176
|
-
- test/test_persistent.rb
|
177
|
-
- test/test_puma_server.rb
|
178
|
-
- test/test_puma_server_ssl.rb
|
179
|
-
- test/test_rack_handler.rb
|
180
|
-
- test/test_rack_server.rb
|
181
|
-
- test/test_tcp_rack.rb
|
182
|
-
- test/test_thread_pool.rb
|
183
|
-
- test/test_unix_socket.rb
|
184
|
-
- test/test_ws.rb
|
185
167
|
- lib/puma/puma_http11.jar
|
186
168
|
homepage: http://puma.io
|
187
169
|
licenses:
|
@@ -209,22 +191,4 @@ rubygems_version: 2.1.9
|
|
209
191
|
signing_key:
|
210
192
|
specification_version: 4
|
211
193
|
summary: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications
|
212
|
-
test_files:
|
213
|
-
- test/test_app_status.rb
|
214
|
-
- test/test_cli.rb
|
215
|
-
- test/test_config.rb
|
216
|
-
- test/test_http10.rb
|
217
|
-
- test/test_http11.rb
|
218
|
-
- test/test_integration.rb
|
219
|
-
- test/test_iobuffer.rb
|
220
|
-
- test/test_minissl.rb
|
221
|
-
- test/test_null_io.rb
|
222
|
-
- test/test_persistent.rb
|
223
|
-
- test/test_puma_server.rb
|
224
|
-
- test/test_puma_server_ssl.rb
|
225
|
-
- test/test_rack_handler.rb
|
226
|
-
- test/test_rack_server.rb
|
227
|
-
- test/test_tcp_rack.rb
|
228
|
-
- test/test_thread_pool.rb
|
229
|
-
- test/test_unix_socket.rb
|
230
|
-
- test/test_ws.rb
|
194
|
+
test_files: []
|
data/test/test_app_status.rb
DELETED
@@ -1,92 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require 'rack'
|
3
|
-
require 'puma/app/status'
|
4
|
-
|
5
|
-
class TestAppStatus < Test::Unit::TestCase
|
6
|
-
class FakeServer
|
7
|
-
def initialize
|
8
|
-
@status = :running
|
9
|
-
@backlog = 0
|
10
|
-
@running = 0
|
11
|
-
end
|
12
|
-
|
13
|
-
attr_reader :status
|
14
|
-
attr_accessor :backlog, :running
|
15
|
-
|
16
|
-
def stop
|
17
|
-
@status = :stop
|
18
|
-
end
|
19
|
-
|
20
|
-
def halt
|
21
|
-
@status = :halt
|
22
|
-
end
|
23
|
-
|
24
|
-
def stats
|
25
|
-
"{}"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def setup
|
30
|
-
@server = FakeServer.new
|
31
|
-
@app = Puma::App::Status.new(@server)
|
32
|
-
@app.auth_token = nil
|
33
|
-
end
|
34
|
-
|
35
|
-
def lint(uri)
|
36
|
-
app = Rack::Lint.new @app
|
37
|
-
mock_env = Rack::MockRequest.env_for uri
|
38
|
-
app.call mock_env
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_bad_token
|
42
|
-
@app.auth_token = "abcdef"
|
43
|
-
|
44
|
-
status, _, _ = lint('/whatever')
|
45
|
-
|
46
|
-
assert_equal 403, status
|
47
|
-
end
|
48
|
-
|
49
|
-
def test_good_token
|
50
|
-
@app.auth_token = "abcdef"
|
51
|
-
|
52
|
-
status, _, _ = lint('/whatever?token=abcdef')
|
53
|
-
|
54
|
-
assert_equal 404, status
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_unsupported
|
58
|
-
status, _, _ = lint('/not-real')
|
59
|
-
|
60
|
-
assert_equal 404, status
|
61
|
-
end
|
62
|
-
|
63
|
-
def test_stop
|
64
|
-
status, _ , app = lint('/stop')
|
65
|
-
|
66
|
-
assert_equal :stop, @server.status
|
67
|
-
assert_equal 200, status
|
68
|
-
assert_equal ['{ "status": "ok" }'], app.enum_for.to_a
|
69
|
-
end
|
70
|
-
|
71
|
-
def test_halt
|
72
|
-
status, _ , app = lint('/halt')
|
73
|
-
|
74
|
-
assert_equal :halt, @server.status
|
75
|
-
assert_equal 200, status
|
76
|
-
assert_equal ['{ "status": "ok" }'], app.enum_for.to_a
|
77
|
-
end
|
78
|
-
|
79
|
-
def test_stats
|
80
|
-
@server.backlog = 1
|
81
|
-
@server.running = 9
|
82
|
-
status, _ , app = lint('/stats')
|
83
|
-
|
84
|
-
assert_equal 200, status
|
85
|
-
assert_equal ['{}'], app.enum_for.to_a
|
86
|
-
end
|
87
|
-
|
88
|
-
def test_alternate_location
|
89
|
-
status, _ , _ = lint('__alternatE_location_/stats')
|
90
|
-
assert_equal 200, status
|
91
|
-
end
|
92
|
-
end
|
data/test/test_cli.rb
DELETED
@@ -1,173 +0,0 @@
|
|
1
|
-
require "rbconfig"
|
2
|
-
require 'test/unit'
|
3
|
-
require 'puma/cli'
|
4
|
-
require 'tempfile'
|
5
|
-
|
6
|
-
class TestCLI < Test::Unit::TestCase
|
7
|
-
def setup
|
8
|
-
@environment = 'production'
|
9
|
-
@tmp_file = Tempfile.new("puma-test")
|
10
|
-
@tmp_path = @tmp_file.path
|
11
|
-
@tmp_file.close!
|
12
|
-
|
13
|
-
@tmp_path2 = "#{@tmp_path}2"
|
14
|
-
|
15
|
-
File.unlink @tmp_path if File.exist? @tmp_path
|
16
|
-
File.unlink @tmp_path2 if File.exist? @tmp_path2
|
17
|
-
|
18
|
-
@wait, @ready = IO.pipe
|
19
|
-
|
20
|
-
@events = Events.strings
|
21
|
-
@events.on_booted { @ready << "!" }
|
22
|
-
end
|
23
|
-
|
24
|
-
def wait_booted
|
25
|
-
@wait.sysread 1
|
26
|
-
end
|
27
|
-
|
28
|
-
def teardown
|
29
|
-
File.unlink @tmp_path if File.exist? @tmp_path
|
30
|
-
File.unlink @tmp_path2 if File.exist? @tmp_path2
|
31
|
-
|
32
|
-
@wait.close
|
33
|
-
@ready.close
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_pid_file
|
37
|
-
cli = Puma::CLI.new ["--pidfile", @tmp_path]
|
38
|
-
cli.send(:parse_options)
|
39
|
-
cli.write_pid
|
40
|
-
|
41
|
-
assert_equal File.read(@tmp_path).strip.to_i, Process.pid
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_control_for_tcp
|
45
|
-
url = "tcp://127.0.0.1:9877/"
|
46
|
-
cli = Puma::CLI.new ["-b", "tcp://127.0.0.1:9876",
|
47
|
-
"--control", url,
|
48
|
-
"--control-token", "",
|
49
|
-
"test/lobster.ru"], @events
|
50
|
-
|
51
|
-
cli.send(:parse_options)
|
52
|
-
|
53
|
-
thread_exception = nil
|
54
|
-
t = Thread.new do
|
55
|
-
begin
|
56
|
-
cli.run
|
57
|
-
rescue Exception => e
|
58
|
-
thread_exception = e
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
wait_booted
|
63
|
-
|
64
|
-
s = TCPSocket.new "127.0.0.1", 9877
|
65
|
-
s << "GET /stats HTTP/1.0\r\n\r\n"
|
66
|
-
body = s.read
|
67
|
-
assert_equal '{ "backlog": 0, "running": 0 }', body.split("\r\n").last
|
68
|
-
|
69
|
-
cli.stop
|
70
|
-
t.join
|
71
|
-
assert_equal nil, thread_exception
|
72
|
-
end
|
73
|
-
|
74
|
-
unless defined?(JRUBY_VERSION) || RbConfig::CONFIG["host_os"] =~ /mingw|mswin/
|
75
|
-
def test_control
|
76
|
-
url = "unix://#{@tmp_path}"
|
77
|
-
|
78
|
-
cli = Puma::CLI.new ["-b", "unix://#{@tmp_path2}",
|
79
|
-
"--control", url,
|
80
|
-
"--control-token", "",
|
81
|
-
"test/lobster.ru"], @events
|
82
|
-
cli.send(:parse_options)
|
83
|
-
|
84
|
-
t = Thread.new { cli.run }
|
85
|
-
|
86
|
-
wait_booted
|
87
|
-
|
88
|
-
s = UNIXSocket.new @tmp_path
|
89
|
-
s << "GET /stats HTTP/1.0\r\n\r\n"
|
90
|
-
body = s.read
|
91
|
-
|
92
|
-
assert_equal '{ "backlog": 0, "running": 0 }', body.split("\r\n").last
|
93
|
-
|
94
|
-
cli.stop
|
95
|
-
t.join
|
96
|
-
end
|
97
|
-
|
98
|
-
def test_control_stop
|
99
|
-
url = "unix://#{@tmp_path}"
|
100
|
-
|
101
|
-
cli = Puma::CLI.new ["-b", "unix://#{@tmp_path2}",
|
102
|
-
"--control", url,
|
103
|
-
"--control-token", "",
|
104
|
-
"test/lobster.ru"], @events
|
105
|
-
cli.send(:parse_options)
|
106
|
-
|
107
|
-
t = Thread.new { cli.run }
|
108
|
-
|
109
|
-
wait_booted
|
110
|
-
|
111
|
-
s = UNIXSocket.new @tmp_path
|
112
|
-
s << "GET /stop HTTP/1.0\r\n\r\n"
|
113
|
-
body = s.read
|
114
|
-
|
115
|
-
assert_equal '{ "status": "ok" }', body.split("\r\n").last
|
116
|
-
|
117
|
-
t.join
|
118
|
-
end
|
119
|
-
|
120
|
-
def test_tmp_control
|
121
|
-
url = "tcp://127.0.0.1:8232"
|
122
|
-
cli = Puma::CLI.new ["--state", @tmp_path, "--control", "auto"]
|
123
|
-
cli.send(:parse_options)
|
124
|
-
cli.write_state
|
125
|
-
|
126
|
-
data = YAML.load File.read(@tmp_path)
|
127
|
-
|
128
|
-
assert_equal Process.pid, data["pid"]
|
129
|
-
|
130
|
-
url = data["config"].options[:control_url]
|
131
|
-
|
132
|
-
m = %r!unix://(.*)!.match(url)
|
133
|
-
|
134
|
-
assert m, "'#{url}' is not a URL"
|
135
|
-
end
|
136
|
-
end # JRUBY or Windows
|
137
|
-
|
138
|
-
def test_state
|
139
|
-
url = "tcp://127.0.0.1:8232"
|
140
|
-
cli = Puma::CLI.new ["--state", @tmp_path, "--control", url]
|
141
|
-
cli.send(:parse_options)
|
142
|
-
cli.write_state
|
143
|
-
|
144
|
-
data = YAML.load File.read(@tmp_path)
|
145
|
-
|
146
|
-
assert_equal Process.pid, data["pid"]
|
147
|
-
assert_equal url, data["config"].options[:control_url]
|
148
|
-
end
|
149
|
-
|
150
|
-
def test_load_path
|
151
|
-
cli = Puma::CLI.new ["--include", 'foo/bar']
|
152
|
-
cli.send(:parse_options)
|
153
|
-
|
154
|
-
assert_equal 'foo/bar', $LOAD_PATH[0]
|
155
|
-
$LOAD_PATH.shift
|
156
|
-
|
157
|
-
cli = Puma::CLI.new ["--include", 'foo/bar:baz/qux']
|
158
|
-
cli.send(:parse_options)
|
159
|
-
|
160
|
-
assert_equal 'foo/bar', $LOAD_PATH[0]
|
161
|
-
$LOAD_PATH.shift
|
162
|
-
assert_equal 'baz/qux', $LOAD_PATH[0]
|
163
|
-
$LOAD_PATH.shift
|
164
|
-
end
|
165
|
-
|
166
|
-
def test_environment
|
167
|
-
cli = Puma::CLI.new ["--environment", @environment]
|
168
|
-
cli.send(:parse_options)
|
169
|
-
cli.send(:set_rack_environment)
|
170
|
-
|
171
|
-
assert_equal ENV['RACK_ENV'], @environment
|
172
|
-
end
|
173
|
-
end
|