summaryrefslogtreecommitdiff
path: root/lib/net/ftp.rb
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-19 14:21:05 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-19 14:21:05 +0000
commit64e6f141fa676483b7dceb793d784d242d3def1f (patch)
treeaa848abc50351501c4e5142aeecbb8e4454f793d /lib/net/ftp.rb
parent62f1364742aa08859813e940c7647663936a4f77 (diff)
* lib/net/ftp.rb (putbinaryfile): use APPE for resume.
Thanks, Tomoyuki Chikanaga. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/ftp.rb')
-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 c35ee368af..0bf1fb25ca 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