aboutsummaryrefslogtreecommitdiffstats
path: root/lib/net/protocol.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/protocol.rb')
-rw-r--r--lib/net/protocol.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb
index 797966ac7d..0e887d5aa9 100644
--- a/lib/net/protocol.rb
+++ b/lib/net/protocol.rb
@@ -119,12 +119,14 @@ module Net # :nodoc:
read_bytes = 0
begin
while read_bytes + @rbuf.size < len
- dest << (s = rbuf_consume(@rbuf.size))
+ s = rbuf_consume(@rbuf.size)
read_bytes += s.size
+ dest << s
rbuf_fill
end
- dest << (s = rbuf_consume(len - read_bytes))
+ s = rbuf_consume(len - read_bytes)
read_bytes += s.size
+ dest << s
rescue EOFError
raise unless ignore_eof
end
@@ -137,8 +139,9 @@ module Net # :nodoc:
read_bytes = 0
begin
while true
- dest << (s = rbuf_consume(@rbuf.size))
+ s = rbuf_consume(@rbuf.size)
read_bytes += s.size
+ dest << s
rbuf_fill
end
rescue EOFError