From 757a2d5a982c6bb3a722c74aa8816d5f204f742d Mon Sep 17 00:00:00 2001 From: shugo Date: Thu, 19 Nov 2009 14:21:05 +0000 Subject: * lib/net/ftp.rb (putbinaryfile): use APPE for resume. Thanks, Tomoyuki Chikanaga. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/ftp.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index c35ee368a..0bf1fb25c 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -461,7 +461,7 @@ module Net end synchronize do with_binary(true) do - conn = transfercmd(cmd, rest_offset) + conn = transfercmd(cmd) loop do buf = file.read(blocksize) break if buf == nil @@ -605,7 +605,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 -- cgit