[Mono-bugs] [Bug 533882] New: HttpWebRequest fails inside a ASP.NET page: Socket::CheckProtocolSupport()

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Aug 24 17:19:15 EDT 2009


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


           Summary: HttpWebRequest fails inside a ASP.NET page:
                    Socket::CheckProtocolSupport()
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.4.x
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: gonzalo at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Save the following code to 'index.aspx' and run xsp2. Then go with your browser
to http://127.0.0.1:8080/index.aspx
----index.aspx-------------------
<%@ Page %>
<%@ Import namespace="System.Net" %>
<html>
<script runat="Server">
    void Page_Load(object sender, EventArgs e)
    {
        lblText.Text = GetText();
    }

    private string GetText()
    {
        HttpWebRequest req =
(HttpWebRequest)WebRequest.Create("http://www.google.com");
        HttpWebResponse resp = (HttpWebResponse)req.GetResponse();

        string[] names = resp.Headers.AllKeys;

       string text = string.Format("{0,-20}{1}\n", "Name", "Value");

        foreach (string n in names)
            text += string.Format("{0,-20}{1}", n, resp.Headers[n]);

        resp.Close();

        return text;
    }
</script>
<body>
<asp:Label id="lblText" runat="server" />
</body>
</html>
----------END index.aspx---------------

When running it in an amd64 mono, this fails because of a nullref in
System.Net.Sockets::CheckProtocolSupport when SettingsSection is null. Running
the same thing in a 32-bits mono works fine.

-- 
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