[Mono-bugs] [Bug 75176][Nor] New - WebResponse.Close does not immediately send the response

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jun 8 06:34:45 EDT 2005


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 lluis at ximian.com.

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

--- shadow/75176	2005-06-08 06:34:45.000000000 -0400
+++ shadow/75176.tmp.25914	2005-06-08 06:34:45.000000000 -0400
@@ -0,0 +1,68 @@
+Bug#: 75176
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Web
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: lluis at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: WebResponse.Close does not immediately send the response
+
+Run this handler in XSP:
+
+<%@ WebHandler Language="c#" class="XSPTest.EmptyTest" %>
+
+using System;
+using System.Web;
+
+namespace XSPTest
+{
+	public class EmptyTest : IHttpHandler
+	{
+		public void ProcessRequest (HttpContext context)
+		{
+			context.Response.BufferOutput = true;
+			context.Response.StatusCode = 202;
+			context.Response.Flush ();
+			context.Response.Close ();
+			System.Threading.Thread.Sleep (10000);
+		}
+
+		public bool IsReusable {
+			get { return true; }
+		}
+	}
+}
+
+and now this client on Mono:
+
+using System;
+using System.IO;
+using System.Net;
+
+public class Test
+{
+	public static void Main ()
+	{
+		WebRequest req = WebRequest.Create ("http://localhost:8080/kk.ashx");
+		StreamReader sr = new StreamReader (req.GetResponse().GetResponseStream ());
+		sr.ReadToEnd ();
+		Console.WriteLine ("Done!");
+	}
+}
+
+The result is that the client takes 10 seconds to read the whole response,
+due to the Sleep in the handler. But that Sleep is called after
+Response.Close, so the client should not be affected by that wait.
+
+Running the ashx in IIS (and the client on mono) gives the expected
+results: the response is immediately closed and the client is not affected
+by that wait.


More information about the mono-bugs mailing list