[Mono-bugs] [Bug 491590] The FTPWebRequest class doesn't properly resume file downloads

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Apr 6 00:13:33 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=491590

User gonzalo at novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=491590#c1


Gonzalo Paniagua Javier <gonzalo at novell.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME




--- Comment #1 from Gonzalo Paniagua Javier <gonzalo at novell.com>  2009-04-05 22:13:32 MDT ---
I just tried running this program against a local vsftpd:
============BEGIN ftp.cs=================
using System;
using System.IO;
using System.Net;

class Test {
        static void Main ()
        {
                string local_copy = "/tmp/file";
                FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create
("ftp://localhost/somefile.tgz");
                ftp.Credentials = new NetworkCredential ("user", "password");
                ftp.Method = WebRequestMethods.Ftp.DownloadFile;
                // '/tmp/file' must exist ("dd if=somefile.tgz of=/tmp/file
bs=512 count=16" can create a base file
                ftp.ContentOffset = new FileInfo ("/tmp/file").Length;
                FtpWebResponse response = (FtpWebResponse)ftp.GetResponse ();
                byte [] buffer = new byte [8192];
                using (Stream input = response.GetResponseStream ()) {
                        using (Stream output = File.Open ("/tmp/file",
FileMode.Append)) {
                                int nread;
                                while ((nread = input.Read (buffer, 0,
buffer.Length)) > 0) {
                                        output.Write (buffer, 0, nread);
                                }
                        }
                }
        }
}

============END ftp.cs=================

And the vsftpd logs show these lines:
"REST 8192"
"350 Restart position accepted (8192)."
"PASV"
"227 Entering Passive Mode (127,0,0,1,91,11)"
"RETR ttffonts.tgz"
"150 Opening BINARY mode data connection for somefile.tgz (10972832 bytes)."
"/home/gonzalo/somefile.tgz", 10964640 bytes, 113522.36Kbyte/sec
"226 File send OK."

I also compared the FtpWebRequest.cs in HEAD with the one in 2.4 and they are
exactly the same.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list