unicorn 5.7.0 → 5.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +2 -1
- data/lib/unicorn/http_server.rb +4 -0
- data/test/unit/test_server.rb +44 -0
- data/unicorn.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3166eb1eac760d39cac35a6fc46332d6a6a2ee75bdf594118fddb3c6a959f6d
|
4
|
+
data.tar.gz: 3e18599fef201efdd79c67eb126aab35787c196054313a727d6bb184f830587e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 356f0c951cee2e69de8e49169f2c9560e6fead9fe759bd0af5a51097888a23794eb17175ff5393f07d1fadec5678215b494b688cdeeadb8a95c37201f3808a92
|
7
|
+
data.tar.gz: ffa1f8781231ac559157310d2d235340522c6c1cccf69be3d87d432659d2a2a7a39d744a84306c1f4292a3f6b36141cc1bb80497f1a9047902ec0d592f77871b
|
data/GIT-VERSION-GEN
CHANGED
data/GNUmakefile
CHANGED
@@ -245,7 +245,8 @@ publish_doc:
|
|
245
245
|
$(MAKE) doc
|
246
246
|
$(MAKE) doc_gz
|
247
247
|
chmod 644 $$(find doc -type f)
|
248
|
-
$(RSYNC) -av doc/ yhbt.net:/srv/yhbt/unicorn/
|
248
|
+
$(RSYNC) -av doc/ yhbt.net:/srv/yhbt/unicorn/ \
|
249
|
+
--exclude index.html* --exclude created.rid*
|
249
250
|
git ls-files | xargs touch
|
250
251
|
|
251
252
|
# Create gzip variants of the same timestamp as the original so nginx
|
data/lib/unicorn/http_server.rb
CHANGED
@@ -629,6 +629,8 @@ def process_client(client)
|
|
629
629
|
end
|
630
630
|
end
|
631
631
|
|
632
|
+
env["rack.after_reply"] = []
|
633
|
+
|
632
634
|
status, headers, body = @app.call(env)
|
633
635
|
|
634
636
|
begin
|
@@ -651,6 +653,8 @@ def process_client(client)
|
|
651
653
|
end
|
652
654
|
rescue => e
|
653
655
|
handle_error(client, e)
|
656
|
+
ensure
|
657
|
+
env["rack.after_reply"].each(&:call) if env
|
654
658
|
end
|
655
659
|
|
656
660
|
def nuke_listeners!(readers)
|
data/test/unit/test_server.rb
CHANGED
@@ -34,6 +34,24 @@ def call(env)
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
class TestRackAfterReply
|
38
|
+
def initialize
|
39
|
+
@called = false
|
40
|
+
end
|
41
|
+
|
42
|
+
def call(env)
|
43
|
+
while env['rack.input'].read(4096)
|
44
|
+
end
|
45
|
+
|
46
|
+
env["rack.after_reply"] << -> { @called = true }
|
47
|
+
|
48
|
+
[200, { 'Content-Type' => 'text/plain' }, ["after_reply_called: #{@called}"]]
|
49
|
+
rescue Unicorn::ClientShutdown, Unicorn::HttpParserError => e
|
50
|
+
$stderr.syswrite("#{e.class}: #{e.message} #{e.backtrace.empty?}\n")
|
51
|
+
raise e
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
37
55
|
class WebServerTest < Test::Unit::TestCase
|
38
56
|
|
39
57
|
def setup
|
@@ -114,6 +132,32 @@ def test_early_hints
|
|
114
132
|
assert_match %r{^HTTP/1.[01] 200\b}, responses
|
115
133
|
end
|
116
134
|
|
135
|
+
def test_after_reply
|
136
|
+
teardown
|
137
|
+
|
138
|
+
redirect_test_io do
|
139
|
+
@server = HttpServer.new(TestRackAfterReply.new,
|
140
|
+
:listeners => [ "127.0.0.1:#@port"])
|
141
|
+
@server.start
|
142
|
+
end
|
143
|
+
|
144
|
+
sock = TCPSocket.new('127.0.0.1', @port)
|
145
|
+
sock.syswrite("GET / HTTP/1.0\r\n\r\n")
|
146
|
+
|
147
|
+
responses = sock.read(4096)
|
148
|
+
assert_match %r{\AHTTP/1.[01] 200\b}, responses
|
149
|
+
assert_match %r{^after_reply_called: false}, responses
|
150
|
+
|
151
|
+
sock = TCPSocket.new('127.0.0.1', @port)
|
152
|
+
sock.syswrite("GET / HTTP/1.0\r\n\r\n")
|
153
|
+
|
154
|
+
responses = sock.read(4096)
|
155
|
+
assert_match %r{\AHTTP/1.[01] 200\b}, responses
|
156
|
+
assert_match %r{^after_reply_called: true}, responses
|
157
|
+
|
158
|
+
sock.close
|
159
|
+
end
|
160
|
+
|
117
161
|
def test_broken_app
|
118
162
|
teardown
|
119
163
|
app = lambda { |env| raise RuntimeError, "hello" }
|
data/unicorn.gemspec
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
Gem::Specification.new do |s|
|
13
13
|
s.name = %q{unicorn}
|
14
|
-
s.version = (ENV['VERSION'] || '5.
|
14
|
+
s.version = (ENV['VERSION'] || '5.8.0').dup
|
15
15
|
s.authors = ['unicorn hackers']
|
16
16
|
s.summary = 'Rack HTTP server for fast clients and Unix'
|
17
17
|
s.description = File.read('README').split("\n\n")[1]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- unicorn hackers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|