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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c8762bfa015cb5a12f8303fe2a4cd1301fd6e518957939de7f8891fcbae46e5
4
- data.tar.gz: bd8f3c666a29d11637e27791b51e7c6f37c4ab2062ac54a90f8865409422ec17
3
+ metadata.gz: d3166eb1eac760d39cac35a6fc46332d6a6a2ee75bdf594118fddb3c6a959f6d
4
+ data.tar.gz: 3e18599fef201efdd79c67eb126aab35787c196054313a727d6bb184f830587e
5
5
  SHA512:
6
- metadata.gz: 27dca95b35706b39320545819c99cc3e1834efa9790b9b3875a720301ec962327bf0b5bd2fdda6aea5b0318c39d568d3086d52683804ab9297905a8aa61a8b7a
7
- data.tar.gz: 2d7dac7bae31ba658bd9358932b3d254885b0bbefca229b5004b3da48ce2acc5a06240b44d7c4e58fe59b0c511374bf6b9c93de0a703c2ef7af5b45894edf830
6
+ metadata.gz: 356f0c951cee2e69de8e49169f2c9560e6fead9fe759bd0af5a51097888a23794eb17175ff5393f07d1fadec5678215b494b688cdeeadb8a95c37201f3808a92
7
+ data.tar.gz: ffa1f8781231ac559157310d2d235340522c6c1cccf69be3d87d432659d2a2a7a39d744a84306c1f4292a3f6b36141cc1bb80497f1a9047902ec0d592f77871b
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- DEF_VER = "v5.7.0"
2
+ DEF_VER = "v5.8.0"
3
3
  CONSTANT = "Unicorn::Const::UNICORN_VERSION"
4
4
  RVF = "lib/unicorn/version.rb"
5
5
  GVF = "GIT-VERSION-FILE"
@@ -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
@@ -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)
@@ -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" }
@@ -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.7.0').dup
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.7.0
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-09-08 00:00:00.000000000 Z
11
+ date: 2020-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack