[System]: SslStream.Flush() now flushes the underlying stream. Bug #57528. (#5569)
authorMartin Baulig <mabaul@microsoft.com>
Thu, 14 Sep 2017 17:17:19 +0000 (13:17 -0400)
committerGitHub <noreply@github.com>
Thu, 14 Sep 2017 17:17:19 +0000 (13:17 -0400)
* Mono.Security.Interface.IMonoSslStream: removed Flush().

* Mono.Net.Security.MobileAuthenticatedStream: Flush() now calls `InnerStream.Flush ()'.

* System.Net.Security.SslStream: Flush() now calls `InnerStream.Flush ()'.

* System.Net.Security.SslStream: fix `CanRead`, `CanWrite` and `CanTimeout` logic.

mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs
mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs
mcs/class/System/System.Net.Security/SslStream.cs

index 0b64495fc5f209631711c8c91187269d3bc4c29e..131ebab00e64944cb787202945540d24243dec24 100644 (file)
@@ -71,8 +71,6 @@ namespace Mono.Security.Interface
 
                Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation);
 
-               void Flush ();
-
                int Read (byte[] buffer, int offset, int count);
 
                void Write (byte[] buffer);
index 95ecb8fd64a2d1e8a4a59296eba02dd660a86bea..ee3aa44c49e66e731c5b7e5d00f6e7c68f1dc3d3 100644 (file)
@@ -707,7 +707,7 @@ namespace Mono.Net.Security
 
                public override void Flush ()
                {
-                       // Write() automatically flushes the underlying stream.
+                       InnerStream.Flush ();
                }
 
                public SslProtocols SslProtocol {
index c0b702fde1b2f92798271fdf943402e1460eb27a..a536f3bb8224edc5cd599737bca41c05631efc3e 100644 (file)
@@ -293,15 +293,15 @@ namespace System.Net.Security
                }
 
                public override bool CanRead {
-                       get { return Impl.CanRead; }
+                       get { return impl != null && impl.CanRead; }
                }
 
                public override bool CanTimeout {
-                       get { return Impl.CanTimeout; }
+                       get { return InnerStream.CanTimeout; }
                }
 
                public override bool CanWrite {
-                       get { return Impl.CanWrite; }
+                       get { return impl != null && impl.CanWrite; }
                }
 
                public override int ReadTimeout {
@@ -337,7 +337,7 @@ namespace System.Net.Security
 
                public override void Flush ()
                {
-                       Impl.Flush ();
+                       InnerStream.Flush ();
                }
 
                void CheckDisposed ()