diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-19 14:21:05 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-19 14:21:05 +0000 |
commit | 757a2d5a982c6bb3a722c74aa8816d5f204f742d (patch) | |
tree | aa848abc50351501c4e5142aeecbb8e4454f793d | |
parent | 31df10153e035624affe7d16c2b0dfba12918075 (diff) | |
download | ruby-757a2d5a982c6bb3a722c74aa8816d5f204f742d.tar.gz ruby-757a2d5a982c6bb3a722c74aa8816d5f204f742d.tar.xz ruby-757a2d5a982c6bb3a722c74aa8816d5f204f742d.zip |
* 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/net/ftp.rb | 8 |
2 files changed, 11 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Thu Nov 19 23:17:06 2009 Shugo Maeda <shugo@ruby-lang.org> + + * lib/net/ftp.rb (putbinaryfile): use APPE for resume. + Thanks, Tomoyuki Chikanaga. + Thu Nov 19 22:50:05 2009 Shugo Maeda <shugo@ruby-lang.org> * lib/net/imap.rb (flag_list): untaint strings to intern in the safe 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 |