[前][次][番号順一覧][スレッド一覧]

ruby-changes:14052

From: shugo <ko1@a...>
Date: Thu, 19 Nov 2009 23:24:05 +0900 (JST)
Subject: [ruby-changes:14052] Ruby:r25863 (ruby_1_8): * lib/net/ftp.rb (putbinaryfile): use APPE for resume.

shugo	2009-11-19 23:23:45 +0900 (Thu, 19 Nov 2009)

  New Revision: 25863

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25863

  Log:
    * lib/net/ftp.rb (putbinaryfile): use APPE for resume.
      Thanks, Tomoyuki Chikanaga.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/net/ftp.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 25862)
+++ ruby_1_8/ChangeLog	(revision 25863)
@@ -1,3 +1,8 @@
+Thu Nov 19 23:22:40 2009  Shugo Maeda  <shugo@r...>
+
+	* lib/net/ftp.rb (putbinaryfile): use APPE for resume.
+	  Thanks, Tomoyuki Chikanaga.
+
 Thu Nov 19 22:34:49 2009  Shugo Maeda  <shugo@r...>
 
 	* lib/net/imap.rb (flag_list): untaint strings to intern in the safe
Index: ruby_1_8/lib/net/ftp.rb
===================================================================
--- ruby_1_8/lib/net/ftp.rb	(revision 25862)
+++ ruby_1_8/lib/net/ftp.rb	(revision 25863)
@@ -449,7 +449,7 @@
       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 @@
       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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]