about summary refs log tree commit homepage
path: root/test/unit/test_upload.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-06-29 05:11:13 -0700
committerEric Wong <normalperson@yhbt.net>2009-06-29 05:11:13 -0700
commit2c53b32bf651966d3eb39850cc6be019eda51df0 (patch)
treef0287a19aef1e8270250fcf2ffa3c1a89ac0756f /test/unit/test_upload.rb
parent0d3aa1eb6bc7646c9bde78b0fae4e34bc5876421 (diff)
downloadunicorn-2c53b32bf651966d3eb39850cc6be019eda51df0.tar.gz
Diffstat (limited to 'test/unit/test_upload.rb')
-rw-r--r--test/unit/test_upload.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/unit/test_upload.rb b/test/unit/test_upload.rb
index 4c0790f..b69ba4e 100644
--- a/test/unit/test_upload.rb
+++ b/test/unit/test_upload.rb
@@ -119,9 +119,15 @@ class UploadTest < Test::Unit::TestCase
     sock = TCPSocket.new(@addr, @port)
     buf = ' ' * @bs
     sock.syswrite("PUT / HTTP/1.0\r\nContent-Length: #{length}\r\n\r\n")
-    @count.times { sock.syswrite(buf) }
-    assert_raise(Errno::ECONNRESET, Errno::EPIPE) do
-      ::Unicorn::Const::CHUNK_SIZE.times { sock.syswrite(buf) }
+    if Unicorn::HttpRequest::DEFAULTS['unicorn.stream_input']
+      assert_raise(Errno::ECONNRESET, Errno::EPIPE) do
+        @count.times { sock.syswrite(buf) }
+      end
+    else
+      @count.times { sock.syswrite(buf) }
+      assert_raise(Errno::ECONNRESET, Errno::EPIPE) do
+        ::Unicorn::Const::CHUNK_SIZE.times { sock.syswrite(buf) }
+      end
     end
   end