diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-05-04 14:56:44 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-05-04 14:58:04 -0700 |
commit | ec50b892e5d3bc6f585780ebbbf071d489b2c3ae (patch) | |
tree | 652ddab8d153211935ddda7473fb67de5599c49b /lib | |
parent | 3130edb35b3289149cbe7a36ce4e86406a39de35 (diff) | |
download | rainbows-ec50b892e5d3bc6f585780ebbbf071d489b2c3ae.tar.gz |
IO#readpartial on zero bytes will always return an empty string, so ensure the emulator for Revactor does that as well.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rainbows/revactor.rb | 1 |
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)) |