about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-05-04 14:56:44 -0700
committerEric Wong <normalperson@yhbt.net>2010-05-04 14:58:04 -0700
commitec50b892e5d3bc6f585780ebbbf071d489b2c3ae (patch)
tree652ddab8d153211935ddda7473fb67de5599c49b
parent3130edb35b3289149cbe7a36ce4e86406a39de35 (diff)
downloadrainbows-ec50b892e5d3bc6f585780ebbbf071d489b2c3ae.tar.gz
IO#readpartial on zero bytes will always return an empty
string, so ensure the emulator for Revactor does that as
well.
-rw-r--r--lib/rainbows/revactor.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/rainbows/revactor.rb b/lib/rainbows/revactor.rb
index 21fa72f..b1f0d9b 100644
--- a/lib/rainbows/revactor.rb
+++ b/lib/rainbows/revactor.rb
@@ -149,6 +149,7 @@ module Rainbows
       # Revactor socket reads always return an unspecified amount,
       # sometimes too much
       def readpartial(length, dst = "")
+        return dst if length == 0
         # always check and return from the userspace buffer first
         rbuf.size > 0 and return dst.replace(rbuf.read(length))