summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-19 14:23:45 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-19 14:23:45 +0000
commit5cd52d02eb07c2f5232e46bbb2500559901140d2 (patch)
tree0d3257bba6339c98e28bfb5371e2609e5646206f /lib/net
parente5f3893c44798c87574a7ef825beb27252827a15 (diff)
* lib/net/ftp.rb (putbinaryfile): use APPE for resume.
Thanks, Tomoyuki Chikanaga. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/ftp.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 369aba893c..c611e09ee3 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -449,7 +449,7 @@ module Net
end
synchronize do
voidcmd("TYPE I")
- conn = transfercmd(cmd, rest_offset)
+ conn = transfercmd(cmd)
loop do
buf = file.read(blocksize)
break if buf == nil
@@ -559,7 +559,11 @@ module Net
f = open(localfile)
begin
f.binmode
- storbinary("STOR " + remotefile, f, blocksize, rest_offset, &block)
+ if rest_offset
+ storbinary("APPE " + remotefile, f, blocksize, rest_offset, &block)
+ else
+ storbinary("STOR " + remotefile, f, blocksize, rest_offset, &block)
+ end
ensure
f.close
end