From e887427daad73f460c1e7abbbefecc22cddbadc3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 12 May 2011 17:22:57 -0700 Subject: [PATCH] copy_stream: update src_offset on retries Oops :x --- lib/io/splice.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/io/splice.rb b/lib/io/splice.rb index 0802c3b..54a3f04 100644 --- a/lib/io/splice.rb +++ b/lib/io/splice.rb @@ -48,6 +48,7 @@ module IO::Splice rv = 0 while n = partial(src, dst, PIPE_CAPA, src_offset) rv += n + src_offset += n if src_offset end end else @@ -55,11 +56,13 @@ module IO::Splice close.concat(tmp) if len while len != 0 && n = partial(src, w, len, src_offset) + src_offset += n if src_offset len -= full(r, dst, n, nil) end else rv = 0 while n = partial(src, w, PIPE_CAPA, src_offset) + src_offset += n if src_offset rv += full(r, dst, n, nil) end end -- 2.11.4.GIT