X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FSystem.Net%2FHttpWebResponse.cs;h=60bf0a84ee09b708f8cf6c4cf1394de6dc0cca51;hb=b9ce91a104a09cd872c5105edd8d321565c9f3ed;hp=bb4393d9e419c1aa91bf1830c15284f978ae46e6;hpb=1b462e1ef964186146dd5d0bded78da61acf07f5;p=mono.git diff --git a/mcs/class/System/System.Net/HttpWebResponse.cs b/mcs/class/System/System.Net/HttpWebResponse.cs index bb4393d9e41..60bf0a84ee0 100644 --- a/mcs/class/System/System.Net/HttpWebResponse.cs +++ b/mcs/class/System/System.Net/HttpWebResponse.cs @@ -31,7 +31,7 @@ namespace System.Net string contentType; bool disposed = false; - WebConnectionStream stream; + Stream stream; // Constructors @@ -216,6 +216,8 @@ namespace System.Net public override Stream GetResponseStream () { CheckDisposed (); + if (stream == null) + return Stream.Null; if (0 == String.Compare (method, "HEAD", true)) // see par 4.3 & 9.4 return Stream.Null; @@ -270,8 +272,15 @@ namespace System.Net // release unmanaged resources Stream st = stream; stream = null; - if (st != null) + if (st != null) { + WebConnectionStream wce = st as WebConnectionStream; + if (wce != null) { + try { + wce.ReadAll (); + } catch {} + } st.Close (); + } } private void CheckDisposed ()