[Mono-bugs] [Bug 636219] New: WebRequest fails to submit form, timeout occurs. Likely due to mishandling 302 header.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Sep 1 08:32:35 EDT 2010



           Summary: WebRequest fails to submit form, timeout occurs.
                    Likely due to mishandling 302 header.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: i386
        OS/Version: Windows 7
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: spencerthang at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

Created an attachment (id=386826)
 --> (http://bugzilla.novell.com/attachment.cgi?id=386826)
The sample code.

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.51 Safari/534.3

Sample code attached as Program.cs.

WebRequest is used to POST a username/password to the site.
When the user/pass is wrong, the program completes successfully (prints
If the user/pass is correct, the program hangs and errors out with:

Unhandled Exception: System.Net.WebException: The request timed out at
System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x0006c]

Wireshark verifies that the packets are indeed both sent and replied to.

Furthermore, it seems like a 302 header with location is causing this problem.
A correct username/password results in the above header, which causes the
A wrong username/password results in a 200 header, which is fine (doesn't

Tested with mono 2.6.7

Reproducible: Always

Steps to Reproduce:
1. Compile and run the attached Program.cs. The timeout exception occurs.
2. Change "username=b466439&password=b466439" to some other user/pass and
3. Program will then complete successfully.
Actual Results:  
Compiling with .NET Framework results in the resultant page being displayed.

Expected Results:  
Compiling with mono results in 10-seconds of nothing, followed by the timeout

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