<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Report a Silverlight Bug</title><link>http://forums.silverlight.net/forums/28.aspx</link><description>Found a bug in Silverlight? Use this forum to describe the bug and the code or steps to reproduce it.</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: WebRequest, Firefox, AllowReadStreamBuffering and custom headers</title><link>http://forums.silverlight.net/forums/thread/92979.aspx</link><pubDate>Wed, 17 Sep 2008 21:03:44 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:92979</guid><dc:creator>cagdasgerede</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/92979.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=92979</wfw:commentRss><description>Yes. I can read the custom header and the value; the name of the header is HTTP_[name of the header where it is capitalized and - replaced by _] - if your header name is xyz_-abc, then it becomes HTTP_XYZ__ABC.</description></item><item><title>Re: WebRequest, Firefox, AllowReadStreamBuffering and custom headers</title><link>http://forums.silverlight.net/forums/thread/92900.aspx</link><pubDate>Wed, 17 Sep 2008 18:56:14 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:92900</guid><dc:creator>plafond444</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/92900.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=92900</wfw:commentRss><description>&lt;p&gt;Ok, I&amp;#39;ll undust it and see if I get the same result...&lt;br /&gt;&lt;/p&gt;&lt;p&gt;When you set request.Method to POST, can you see the &amp;quot;custom&amp;quot; header (name and value) on the server side?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: WebRequest, Firefox, AllowReadStreamBuffering and custom headers</title><link>http://forums.silverlight.net/forums/thread/92872.aspx</link><pubDate>Wed, 17 Sep 2008 18:29:12 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:92872</guid><dc:creator>cagdasgerede</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/92872.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=92872</wfw:commentRss><description>I tried your code. I got the following exception 
&amp;quot;Error HRESULT E_FAIL has been returned from a call to a COM component&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When I set the request method to POST with&lt;br /&gt;
request.Method = &amp;quot;POST&amp;quot;, I didn&amp;#39;t get any exceptions and in Firefox, my silverlight app was able to receive every byte sent.&lt;br /&gt;
&lt;br /&gt;
When I set the request method to POST with&lt;br /&gt;
request.Method = &amp;quot;GET&amp;quot;, I again got an exception, due to, I believe, setting a header. So I commented out: &lt;br /&gt;
request.Headers[&amp;quot;custom-header&amp;quot;]=&amp;quot;value&amp;quot;;&lt;br /&gt;
After that, it again worked as expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do you think you are getting an exception when you invoke BeginGetResponse? Please let me know what you think.</description></item><item><title>WebRequest, Firefox, AllowReadStreamBuffering and custom headers</title><link>http://forums.silverlight.net/forums/thread/66782.aspx</link><pubDate>Tue, 01 Jul 2008 03:21:23 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:66782</guid><dc:creator>plafond444</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/66782.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=28&amp;PostID=66782</wfw:commentRss><description>This is either a Silverlight bug or a specific Firefox constraint.
&lt;p&gt;
-&amp;gt;The following works fine in IE.
&lt;p&gt;
On the server side I have a HTTP handler that just writes a string to the Response stream (within a loop). On the client side, I set &lt;b&gt;AllowReadStreamBuffering&lt;/b&gt; to false. If I set a custom header, it seems to &amp;quot;disable&amp;quot; the &lt;b&gt;AllowReadStreamBuffering&lt;/b&gt; since the &lt;b&gt;BeginGetResponse&lt;/b&gt;&amp;#39;s Callback parameter is just called after my httphandler is done (same as if I set to true).
&lt;p&gt;
&lt;b style="color:blue;"&gt;HTTP Handler code:&lt;/b&gt;
&lt;p&gt;&lt;pre style="color:#515151;"&gt;
    public void ProcessRequest(HttpContext context)
    {
        context.Response.Write(&amp;quot;Start write test&amp;quot;+&amp;#39;\n&amp;#39;);
        
        //4kb chunk for IE for test purpose... related to another possible bug in IE
        //string bigfile = File.ReadAllText(&amp;quot;c:\\bigfile.txt&amp;quot;);
        //context.Response.Write(bigfile);
        //context.Response.Flush();

        int nbLoop = 20;
        while (nbLoop &amp;gt; 0)
        {
            Thread.Sleep(2000);

            context.Response.Write(&amp;quot;Write test : &amp;quot; + nbLoop + &amp;#39;\n&amp;#39;);
            context.Response.Flush();
            nbLoop--;
        }

        context.ApplicationInstance.CompleteRequest();
    }
&lt;/pre&gt;
&lt;p&gt;&lt;b style="color:blue;"&gt;Silverlight code: (called on a button&amp;#39;s Click event)&lt;/b&gt;
&lt;p&gt;&lt;pre style="color:#515151;"&gt;
    private void btnGo_Click(object sender, RoutedEventArgs e)
    {
        string serverUri = HtmlPage.Document.DocumentUri.AbsoluteUri;
        serverUri = serverUri.Substring(0, serverUri.LastIndexOf(&amp;quot;/&amp;quot;));
        Uri uri = new Uri(String.Format(&amp;quot;{0}/test.test&amp;quot;, serverUri));

        HttpWebRequest req = WebRequest.Create(uri) as HttpWebRequest;
        req.AllowReadStreamBuffering = false;

        &lt;b style="color:green;"&gt;//uncomment the following to reproduce the bug&lt;/b&gt;
        //req.Headers[&amp;quot;custom-header&amp;quot;] = &amp;quot;custom&amp;quot;;

        req.BeginGetResponse(arResponse =&amp;gt;
        {
            &lt;b style="color:green;"&gt;//with AllowReadStreamBuffering=false, it should step here immediately&lt;/b&gt;
            using (HttpWebResponse svrResp = req.EndGetResponse(arResponse) as HttpWebResponse)
            {
                using (StreamReader sr = new StreamReader(svrResp.GetResponseStream()))
                {
                    int bsize = 256;
                    Char[] buffer = new Char[bsize];
                    int nbByte = sr.Read(buffer, 0, bsize);
                    while (nbByte &amp;gt; 0)
                    {
                        string resultingData = new String(buffer, 0, nbByte);
                        Debug.WriteLine(resultingData);
                        nbByte = sr.Read(buffer, 0, bsize);
                    }
                }
            }
        },null);
    }
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;
I don&amp;#39;t know if someone could confirm this? (I can email the complete VS solution if someone is interested)
&lt;p&gt;
Thanks</description></item></channel></rss>