Removed hard coded timeout for SslStreamBase.
authorKonrad M. Kruczynski <konrad.kruczynski@gmail.com>
Tue, 21 Jun 2011 13:39:44 +0000 (15:39 +0200)
committerKonrad M. Kruczynski <konrad.kruczynski@gmail.com>
Tue, 21 Jun 2011 13:39:44 +0000 (15:39 +0200)
SslStream had hard coded timeout, so it waited no more than five minutes to have send/receive operation completed and then throwing exception even if underlying stream was still fully operational.

mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs

index 646f8d928a402dc83b5bd710c58964385616c7b3..24833d14d2ebc28cd4a427f29ca328fa292b53a6 100644 (file)
@@ -39,9 +39,7 @@ namespace Mono.Security.Protocol.Tls
                
                #region Fields
 
-               static ManualResetEvent record_processing = new ManualResetEvent (true);
-
-               private const int WaitTimeOut = 5 * 60 * 1000;
+               static ManualResetEvent record_processing = new ManualResetEvent (true);        
 
                internal Stream innerStream;
                internal MemoryStream inputBuffer;
@@ -875,7 +873,7 @@ namespace Mono.Security.Protocol.Tls
                        // Always wait until the read is complete
                        if (!asyncResult.IsCompleted)
                        {
-                               if (!asyncResult.AsyncWaitHandle.WaitOne (WaitTimeOut, false))
+                               if (!asyncResult.AsyncWaitHandle.WaitOne ())
                                        throw new TlsException (AlertDescription.InternalError, "Couldn't complete EndRead");
                        }
 
@@ -900,7 +898,7 @@ namespace Mono.Security.Protocol.Tls
 
                        if (!asyncResult.IsCompleted)
                        {
-                               if (!internalResult.AsyncWaitHandle.WaitOne (WaitTimeOut, false))
+                               if (!internalResult.AsyncWaitHandle.WaitOne ())
                                        throw new TlsException (AlertDescription.InternalError, "Couldn't complete EndWrite");
                        }