From: Martin Baulig Date: Thu, 14 Sep 2017 17:17:19 +0000 (-0400) Subject: [System]: SslStream.Flush() now flushes the underlying stream. Bug #57528. (#5569) X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=56c2802ff9d1eec9ac6ab090100bb9cceccc83fb [System]: SslStream.Flush() now flushes the underlying stream. Bug #57528. (#5569) * 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. --- diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs b/mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs index 0b64495fc5f..131ebab00e6 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs @@ -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); diff --git a/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs b/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs index 95ecb8fd64a..ee3aa44c49e 100644 --- a/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs +++ b/mcs/class/System/Mono.Net.Security/MobileAuthenticatedStream.cs @@ -707,7 +707,7 @@ namespace Mono.Net.Security public override void Flush () { - // Write() automatically flushes the underlying stream. + InnerStream.Flush (); } public SslProtocols SslProtocol { diff --git a/mcs/class/System/System.Net.Security/SslStream.cs b/mcs/class/System/System.Net.Security/SslStream.cs index c0b702fde1b..a536f3bb822 100644 --- a/mcs/class/System/System.Net.Security/SslStream.cs +++ b/mcs/class/System/System.Net.Security/SslStream.cs @@ -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 ()