[Mono-bugs] [Bug 59273][Maj] Changed - HttpWebResponse.GetResponseStream() Exception when ContentLength == 0 [TEST CASE ATTACHED]

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 28 May 2004 18:06:43 -0400 (EDT)


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 grompf@sublimeintervention.com.

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

--- shadow/59273	2004-05-28 18:04:18.000000000 -0400
+++ shadow/59273.tmp.22046	2004-05-28 18:06:43.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 59273
 Product: Mono: Class Libraries
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: OSX 10.3.3
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Major
 Component: Sys.Web
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: grompf@sublimeintervention.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -32,6 +32,31 @@
 Return an empty stream.
 
 ------- Additional Comments From grompf@sublimeintervention.com  2004-05-28 18:04 -------
 Created an attachment (id=7903)
 test case
 
+
+------- Additional Comments From grompf@sublimeintervention.com  2004-05-28 18:06 -------
+Index: HttpWebResponse.cs
+=======================================================
+============
+RCS file: /mono/mcs/class/System/System.Net/HttpWebResponse.cs,v
+retrieving revision 1.15
+diff -u -r1.15 HttpWebResponse.cs
+--- HttpWebResponse.cs  13 Oct 2003 00:19:54 -0000      1.15
++++ HttpWebResponse.cs  28 May 2004 21:43:46 -0000
+@@ -217,7 +217,7 @@
+                {
+                        CheckDisposed ();
+                        if (stream == null)
+-                               return Stream.Null;  
++                               return new Stream();
+                        if (0 == String.Compare (method, "HEAD", true)) // see par 4.3 & 9.4
+                                return Stream.Null;  
+ 
+
+
+The above patch should resolve the problem, however I'm unsure if it would break 
+HttpWebResponse in other places, so take it with a grain of salt.
+
+