Merge pull request #4618 from BrzVlad/feature-par-nrs
[mono.git] / mcs / class / System / System.Net / ResponseStream.cs
index 6a47f40ae2a3cf823bfda8923e86cb2a7334e2f1..81e1d6f67d4be3308554d97eb4f01a2ecc97bafa 100644 (file)
@@ -97,7 +97,7 @@ namespace System.Net {
                                                        InternalWrite (bytes, 0, bytes.Length);
                                                        trailer_sent = true;
                                                }
-                                       } catch (IOException ex) {
+                                       } catch (IOException) {
                                                // Ignore error due to connection reset by peer
                                        }
                                }
@@ -143,6 +143,8 @@ namespace System.Net {
                {
                        if (disposed)
                                throw new ObjectDisposedException (GetType ().ToString ());
+                       if (count == 0)
+                               return;
 
                        byte [] bytes = null;
                        MemoryStream ms = GetHeaders (false);