ruby-changes:14051
From: shugo <ko1@a...>
Date: Thu, 19 Nov 2009 23:22:05 +0900 (JST)
Subject: [ruby-changes:14051] Ruby:r25862 (trunk): * lib/net/ftp.rb (putbinaryfile): use APPE for resume.
shugo 2009-11-19 23:21:05 +0900 (Thu, 19 Nov 2009) New Revision: 25862 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25862 Log: * lib/net/ftp.rb (putbinaryfile): use APPE for resume. Thanks, Tomoyuki Chikanaga. Modified files: trunk/ChangeLog trunk/lib/net/ftp.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 25861) +++ ChangeLog (revision 25862) @@ -1,3 +1,8 @@ +Thu Nov 19 23:17:06 2009 Shugo Maeda <shugo@r...> + + * lib/net/ftp.rb (putbinaryfile): use APPE for resume. + Thanks, Tomoyuki Chikanaga. + Thu Nov 19 22:50:05 2009 Shugo Maeda <shugo@r...> * lib/net/imap.rb (flag_list): untaint strings to intern in the safe Index: lib/net/ftp.rb =================================================================== --- lib/net/ftp.rb (revision 25861) +++ lib/net/ftp.rb (revision 25862) @@ -461,7 +461,7 @@ 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 @@ 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/