about summary refs log tree commit homepage
path: root/lib/dtas/buffer
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-12-06 10:01:51 +0000
committerEric Wong <normalperson@yhbt.net>2013-12-06 10:01:51 +0000
commit11a0b07cde0a622f5bfd430b7b78e9994467c850 (patch)
treef653b7c678b8db58a54d82420ec2c76a00d3c0f2 /lib/dtas/buffer
parent3338a0cf6087b981702227734af7817e97498a8e (diff)
downloaddtas-11a0b07cde0a622f5bfd430b7b78e9994467c850.tar.gz
This non-Linux code path probably broke when we minimized our
use of IO#nread.
Diffstat (limited to 'lib/dtas/buffer')
-rw-r--r--lib/dtas/buffer/read_write.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/dtas/buffer/read_write.rb b/lib/dtas/buffer/read_write.rb
index 53b11de..530a08d 100644
--- a/lib/dtas/buffer/read_write.rb
+++ b/lib/dtas/buffer/read_write.rb
@@ -26,12 +26,14 @@ module DTAS::Buffer::ReadWrite # :nodoc:
   # always block when we have a single target
   def broadcast_one(targets)
     buf = _rbuf
-    @to_io.readpartial(MAX_AT_ONCE, buf)
+    @to_io.read_nonblock(MAX_AT_ONCE, buf)
     n = targets[0].write(buf) # IO#write has write-in-full behavior
     @bytes_xfer += n
     :wait_readable
   rescue EOFError
     nil
+  rescue Errno::EAGAIN
+    :wait_readable
   rescue Errno::EPIPE, IOError => e
     __dst_error(targets[0], e)
     targets.clear