diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-06-10 16:00:08 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-06-10 16:00:08 -0700 |
commit | 4651cd8b7c10d18bc745b84ebc7a55aad07d6077 (patch) | |
tree | 01ae0123891d16aa51ab18ff7c65d2dd1f3e733f /test/unit/test_server.rb | |
parent | b0013b043a15d77d810d5965157766c1af364db2 (diff) | |
download | unicorn-4651cd8b7c10d18bc745b84ebc7a55aad07d6077.tar.gz |
No point in making syscalls to deal with empty bodies. Reinstate usage of the NULL_IO object which allows us to avoid allocating new objects.
Diffstat (limited to 'test/unit/test_server.rb')
-rw-r--r-- | test/unit/test_server.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/unit/test_server.rb b/test/unit/test_server.rb index 742b240..0ce373f 100644 --- a/test/unit/test_server.rb +++ b/test/unit/test_server.rb @@ -152,9 +152,18 @@ class WebServerTest < Test::Unit::TestCase def test_file_streamed_request body = "a" * (Unicorn::Const::MAX_BODY * 2) - long = "GET /test HTTP/1.1\r\nContent-length: #{body.length}\r\n\r\n" + body + long = "PUT /test HTTP/1.1\r\nContent-length: #{body.length}\r\n\r\n" + body do_test(long, Unicorn::Const::CHUNK_SIZE * 2 -400) end + def test_file_streamed_request_bad_method + body = "a" * (Unicorn::Const::MAX_BODY * 2) + long = "GET /test HTTP/1.1\r\nContent-length: #{body.length}\r\n\r\n" + body + assert_raises(EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL, + Errno::EBADF) { + do_test(long, Unicorn::Const::CHUNK_SIZE * 2 -400) + } + end + end |