string contentType;
bool disposed = false;
- WebConnectionStream stream;
+ Stream stream;
// Constructors
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;
// 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 ()