[Mono-bugs] [Bug 380262] New: Unhandled Exception System.Net.FtpWebRequest

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Apr 16 01:12:50 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=380262


           Summary: Unhandled Exception System.Net.FtpWebRequest
           Product: Mono: Class Libraries
           Version: 1.9.0
          Platform: x86
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: toby_lang at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


Description of Problem:
 When making multiple calls using the ftpwebrequest object code will eventually
fail with the following exception:

Unhandled Exception: System.Net.WebException: Request aborted
  at System.Net.FtpWebRequest.CheckIfAborted () [0x00018] in
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System/System.Net/FtpWebRequest.cs:1058 
  at System.Net.FtpWebRequest.set_State (RequestState value) [0x0000d] in
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System/System.Net/FtpWebRequest.cs:351 
  at System.Net.FtpWebRequest.ProcessRequest () [0x00047] in
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System/System.Net/FtpWebRequest.cs:510 

Steps to reproduce the problem:

The below code will eventually cause the above exception to occur. If there is
interest in this bug I would be more than happy to provide more details.

using System;
using System.Net;
using System.IO;
namespace WALPftp
{
        class MainClass
        {
                public static void Main(string[] args)
                {
                        string strResponse = null;
            System.Net.FtpWebResponse myWebResponse = null;
            System.Net.FtpWebRequest myWebRequest = null;
                        string [] urls =
{"ftp://ftp.sec.gov/edgar/data/1388744/0001179110-07-003071.txt",              
       "ftp://ftp.sec.gov/edgar/data/1388865/0001281761-07-000050.txt",
"ftp://ftp.sec.gov/edgar/data/1389055/0001389055-07-000004.txt",               
"ftp://ftp.sec.gov/edgar/data/1389055/0001389055-07-000005.txt"};

                        for(;;)
                        {
                                foreach (string url in urls)
                                {
                                        myWebRequest =
(FtpWebRequest)WebRequest.Create(url);
                                        myWebRequest.Method =
WebRequestMethods.Ftp.DownloadFile;
                    StreamReader stream = new
StreamReader(myWebRequest.GetResponse().GetResponseStream());
                    strResponse = stream.ReadToEnd();
                                }
                        }
                }
        }
}


Actual Results: Exception generated as defined above.

Expected Results: No internal exception.

How often does this occur: I use similar code to the above and the error gets
thrown about once ever few hours. Never on the same file.

Additional Information: code has worked in Visual Studio 2005 .NET 2.0 for
months.


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


More information about the mono-bugs mailing list