diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-10-05 22:09:20 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-10-05 22:09:20 +0000 |
commit | fd6b47cf1690cb45f2144cd92e0fe1f301c7c37b (patch) | |
tree | 37c7df590221318380a086269a8aa4c4a20670d4 /test/unit | |
parent | 350e8fa3a94838bcc936782315b3472615fe6517 (diff) | |
download | unicorn-fd6b47cf1690cb45f2144cd92e0fe1f301c7c37b.tar.gz |
TeeInput methods may be invoked deep in the stack, so avoid giving them more work to do if a client disconnects due to a bad upload.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/test_request.rb | 4 | ||||
-rw-r--r-- | test/unit/test_tee_input.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/test/unit/test_request.rb b/test/unit/test_request.rb index 8aae344..5ac511f 100644 --- a/test/unit/test_request.rb +++ b/test/unit/test_request.rb @@ -163,6 +163,10 @@ class RequestTest < Test::Unit::TestCase length = bs * count client = Tempfile.new('big_put') def client.kgio_addr; '127.0.0.1'; end + def client.kgio_read(*args) + readpartial(*args) + rescue EOFError + end client.syswrite( "PUT / HTTP/1.1\r\n" \ "Host: foo\r\n" \ diff --git a/test/unit/test_tee_input.rb b/test/unit/test_tee_input.rb index 56b8952..263aa8a 100644 --- a/test/unit/test_tee_input.rb +++ b/test/unit/test_tee_input.rb @@ -10,7 +10,7 @@ class TestTeeInput < Test::Unit::TestCase def setup @rs = $/ @env = {} - @rd, @wr = UNIXSocket.pair + @rd, @wr = Kgio::UNIXSocket.pair @rd.sync = @wr.sync = true @start_pid = $$ end |