about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-06-29 03:03:35 -0700
committerEric Wong <normalperson@yhbt.net>2009-06-29 04:07:01 -0700
commit93f55bb8802866e8f9a2d741ecec6a75973f2c72 (patch)
tree7c1ac59312f57e9d35f0d247f736e0736b340555
parentd7b3fb8053315c2ecf4d66199b028df5070e1ab8 (diff)
downloadunicorn-93f55bb8802866e8f9a2d741ecec6a75973f2c72.tar.gz
This has been broken since
6945342a1f0a4caaa918f2b0b1efef88824439e0
"Transfer-Encoding: chunked streaming input support" but
somehow never caught by me or anyone else.
-rw-r--r--test/unit/test_upload.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/unit/test_upload.rb b/test/unit/test_upload.rb
index 8bb83c5..4c0790f 100644
--- a/test/unit/test_upload.rb
+++ b/test/unit/test_upload.rb
@@ -103,7 +103,11 @@ class UploadTest < Test::Unit::TestCase
     sock.syswrite('12345') # write 4 bytes more than we expected
     @sha1.update('1')
 
-    read = sock.read.split(/\r\n/)
+    buf = sock.readpartial(4096)
+    while buf !~ /\r\n\r\n/
+      buf << sock.readpartial(4096)
+    end
+    read = buf.split(/\r\n/)
     assert_equal "HTTP/1.1 200 OK", read[0]
     resp = eval(read.grep(/^X-Resp: /).first.sub!(/X-Resp: /, ''))
     assert_equal to_upload, resp[:size]