about summary refs log tree commit homepage
path: root/test/benchmark/big_request.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/benchmark/big_request.rb')
-rw-r--r--test/benchmark/big_request.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/benchmark/big_request.rb b/test/benchmark/big_request.rb
index 5f2111b..a250c62 100644
--- a/test/benchmark/big_request.rb
+++ b/test/benchmark/big_request.rb
@@ -8,7 +8,11 @@ length = bs * count
 slice = (' ' * bs).freeze
 
 big = Tempfile.new('')
-def big.unicorn_peeraddr; '127.0.0.1'; end
+
+def big.unicorn_peeraddr # old versions of Unicorn used this
+  '127.0.0.1'
+end
+
 big.syswrite(
 "PUT /hello/world/puturl?abcd=efg&hi#anchor HTTP/1.0\r\n" \
 "Host: localhost\r\n" \
@@ -22,6 +26,11 @@ big.fsync
 
 include Unicorn
 request = HttpRequest.new(Logger.new($stderr))
+unless request.respond_to?(:reset)
+  def request.reset
+    # no-op
+  end
+end
 
 Benchmark.bmbm do |x|
   x.report("big") do