summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/ftp.rb8
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b83f5d5433..42a9980ab7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Nov 19 23:22:40 2009 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (putbinaryfile): use APPE for resume.
+ Thanks, Tomoyuki Chikanaga.
+
Thu Nov 19 22:34:49 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 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