[Mono-bugs] [Bug 77432][Maj] Changed - System.Net.HttpListener hangs reading past end of a non-chunked response

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Feb 1 11:24:49 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by pawel.sakowski at mind-breeze.com.

http://bugzilla.ximian.com/show_bug.cgi?id=77432

--- shadow/77432	2006-02-01 05:31:53.000000000 -0500
+++ shadow/77432.tmp.8458	2006-02-01 11:24:49.000000000 -0500
@@ -2,13 +2,13 @@
 Product: Mono: Class Libraries
 Version: 1.1
 OS: GNU/Linux [Other]
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Major
 Component: System
 AssignedTo: mono-bugs at ximian.com                            
 ReportedBy: pawel.sakowski at mind-breeze.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -66,6 +66,52 @@
 Relevant headers from the HTTP request generated by TestClient:
 Content-Length: 0
 Expect: 100-continue
 
 Microsoft implementation of the System.Net classes provides the expected
 results.
+
+------- Additional Comments From pawel.sakowski at mind-breeze.com  2006-02-01 11:24 -------
+Chunked HTTP sessions also do not work as expected:
+
+using System;
+using System.Net;
+class TestServer {
+static void Main() {
+HttpListener lis = new HttpListener();
+lis.Prefixes.Add("http://*:5555/");
+lis.Start();
+byte[] buf = new byte[100];
+System.IO.Stream str = lis.GetContext().Request.InputStream;
+Console.WriteLine("read: "+str.Read(buf,0,100));
+Console.WriteLine("read: "+str.Read(buf,0,100));
+}
+}
+
+using System;
+using System.Net;
+class TestClient {
+static void Main() {
+WebRequest req = WebRequest.CreateDefault(new
+Uri("http://127.0.0.1:5555/"));
+req.Method = "POST";
+((HttpWebRequest)req).SendChunked=true;
+System.IO.Stream s=req.GetRequestStream();
+s.Write(new byte[150],0,150);
+s.Flush();
+s.Write(new byte[12],0,12);
+s.Close();
+req.GetResponse();
+}
+}
+
+Actual results:
+read: 100
+read: 0
+
+Expected results:
+Pretty much anything where the second line !=0.
+
+MS.NET gives:
+read: 100
+read: 62
+


More information about the mono-bugs mailing list