Imported Upstream version 5.16.0.127

Former-commit-id: 1babec92ec0b34d7fed163047451926d29f91441
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-08-30 08:22:09 +00:00
parent 07b4df130c
commit 29319da080
48 changed files with 60 additions and 42 deletions

View File

@@ -77,7 +77,7 @@ namespace Mono.Net.Security
Settings = settings;
Provider = provider;
readBuffer = new BufferOffsetSize2 (16834);
readBuffer = new BufferOffsetSize2 (16384);
writeBuffer = new BufferOffsetSize2 (16384);
operation = Operation.None;
}

View File

@@ -50,7 +50,7 @@ using System.Security.Cryptography;
namespace Mono.Net.Security
{
class MonoTlsStream
class MonoTlsStream : IDisposable
{
#if SECURITY_DEP
readonly MonoTlsProvider provider;
@@ -136,6 +136,7 @@ namespace Mono.Net.Security
request.ServicePoint.UpdateClientCertificate (sslStream.InternalLocalCertificate);
else {
request.ServicePoint.UpdateClientCertificate (null);
sslStream.Dispose ();
sslStream = null;
}
}
@@ -154,5 +155,13 @@ namespace Mono.Net.Security
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
#endif
}
public void Dispose ()
{
if (sslStream != null) {
sslStream.Dispose ();
sslStream = null;
}
}
}
}

View File

@@ -405,6 +405,7 @@ namespace System.Net
void CloseSocket ()
{
lock (this) {
Debug ($"WC CLOSE SOCKET: Cnc={ID} NS={networkStream} TLS={monoTlsStream}");
if (networkStream != null) {
try {
networkStream.Dispose ();
@@ -412,6 +413,13 @@ namespace System.Net
networkStream = null;
}
if (monoTlsStream != null) {
try {
monoTlsStream.Dispose ();
} catch { }
monoTlsStream = null;
}
if (socket != null) {
try {
socket.Dispose ();

View File

@@ -41,7 +41,7 @@ namespace System.Net
}
#if MONO_WEB_DEBUG
internal string ME => $"WRS({GetType ().Name}:Op={operation.ID})";
internal string ME => $"WRS({GetType ().Name}:Op={Operation.ID})";
#else
internal string ME => null;
#endif