From dda19354de0bc72c1ab7ea49537a0ae2b019e837 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 8 Feb 2014 03:08:27 -0500 Subject: wbuf_common: avoid trysendfile on empty sf_count We may unnecessarily drop persistent connections from this bug, and we had an incorrect assertion in our unit test, even. --- test/test_wbuf.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/test_wbuf.rb') diff --git a/test/test_wbuf.rb b/test/test_wbuf.rb index 25cdeba..644c76b 100644 --- a/test/test_wbuf.rb +++ b/test/test_wbuf.rb @@ -81,8 +81,8 @@ class TestWbuf < Testcase assert_equal b, IO.select([b], nil, nil, 5)[0][0] b.read(nr - 2) if nr > 2 assert_equal b, IO.select([b], nil, nil, 5)[0][0] - assert_equal "HI", b.read(2) - assert_equal false, wbuf.wbuf_flush(a) + assert_equal "HI", b.read(2), "read the end of the response" + assert_equal true, wbuf.wbuf_flush(a) ensure a.close b.close -- cgit v1.2.3-24-ge0c7