Merge branch 'upstream'

Former-commit-id: bcc61628c4a42be6be289a885ca4c3e2d14c317c
This commit is contained in:
Xamarin Public Jenkins (auto-signing) 2016-10-12 08:36:48 +00:00
commit 17331b25fb
17 changed files with 47 additions and 12 deletions

View File

@ -99,7 +99,8 @@ namespace Mono.Net.Security
Complete, Complete,
WantRead, WantRead,
WantWrite, WantWrite,
ReadDone ReadDone,
FinishWrite
} }
class AsyncProtocolRequest class AsyncProtocolRequest
@ -160,9 +161,16 @@ namespace Mono.Net.Security
Debug ("ResetRead: {0} {1}", oldStatus, Status); Debug ("ResetRead: {0} {1}", oldStatus, Status);
} }
internal void ResetWrite ()
{
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Complete, (int)AsyncOperationStatus.WantWrite);
Debug ("ResetWrite: {0} {1}", oldStatus, Status);
}
internal void RequestWrite () internal void RequestWrite ()
{ {
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.WantWrite, (int)AsyncOperationStatus.Running); var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.WantWrite, (int)AsyncOperationStatus.Running);
Debug ("RequestWrite: {0} {1}", oldStatus, Status);
if (oldStatus == AsyncOperationStatus.Running) if (oldStatus == AsyncOperationStatus.Running)
return; return;
else if (oldStatus != AsyncOperationStatus.WantRead && oldStatus != AsyncOperationStatus.WantWrite) else if (oldStatus != AsyncOperationStatus.WantRead && oldStatus != AsyncOperationStatus.WantWrite)
@ -209,7 +217,19 @@ namespace Mono.Net.Security
status = ProcessOperation (status); status = ProcessOperation (status);
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)status, (int)AsyncOperationStatus.Running); Debug ("ProcessOperation done: {0}", status);
AsyncOperationStatus oldStatus;
if (status == AsyncOperationStatus.Complete) {
oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.FinishWrite, (int)AsyncOperationStatus.WantWrite);
if (oldStatus == AsyncOperationStatus.WantWrite) {
// We are done, but still need to flush the write queue.
status = AsyncOperationStatus.FinishWrite;
continue;
}
}
oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)status, (int)AsyncOperationStatus.Running);
Debug ("ProcessOperation done: {0} -> {1}", oldStatus, status); Debug ("ProcessOperation done: {0} -> {1}", oldStatus, status);
if (oldStatus != AsyncOperationStatus.Running) { if (oldStatus != AsyncOperationStatus.Running) {
@ -243,7 +263,9 @@ namespace Mono.Net.Security
else else
return AsyncOperationStatus.WantRead; return AsyncOperationStatus.WantRead;
} else if (status == AsyncOperationStatus.WantWrite) { } else if (status == AsyncOperationStatus.WantWrite) {
Debug ("ProcessOperation - want write");
Parent.InnerWrite (); Parent.InnerWrite ();
Debug ("ProcessOperation - want write done");
return AsyncOperationStatus.Continue; return AsyncOperationStatus.Continue;
} else if (status == AsyncOperationStatus.Initialize || status == AsyncOperationStatus.Continue) { } else if (status == AsyncOperationStatus.Initialize || status == AsyncOperationStatus.Continue) {
Debug ("ProcessOperation - continue"); Debug ("ProcessOperation - continue");
@ -255,6 +277,11 @@ namespace Mono.Net.Security
status = Operation (this, status); status = Operation (this, status);
Debug ("ProcessOperation - read done: {0}", status); Debug ("ProcessOperation - read done: {0}", status);
return status; return status;
} else if (status == AsyncOperationStatus.FinishWrite) {
Debug ("ProcessOperation - finish write");
Parent.InnerWrite ();
Debug ("ProcessOperation - finish write done");
return AsyncOperationStatus.Complete;
} }
throw new InvalidOperationException (); throw new InvalidOperationException ();

View File

@ -305,6 +305,13 @@ namespace Mono.Net.Security
return new ValidationResult (result, user_denied, 0, (MonoSslPolicyErrors)errors); return new ValidationResult (result, user_denied, 0, (MonoSslPolicyErrors)errors);
} }
// Ignore port number when validating certificates.
if (!string.IsNullOrEmpty (host)) {
var pos = host.IndexOf (':');
if (pos > 0)
host = host.Substring (0, pos);
}
ICertificatePolicy policy = ServicePointManager.GetLegacyCertificatePolicy (); ICertificatePolicy policy = ServicePointManager.GetLegacyCertificatePolicy ();
int status11 = 0; // Error code passed to the obsolete ICertificatePolicy callback int status11 = 0; // Error code passed to the obsolete ICertificatePolicy callback

View File

@ -660,6 +660,7 @@ namespace Mono.Net.Security
if (wantMore || writeBuffer.Size > 0) if (wantMore || writeBuffer.Size > 0)
return AsyncOperationStatus.WantWrite; return AsyncOperationStatus.WantWrite;
asyncRequest.ResetWrite ();
asyncRequest.UserResult = asyncRequest.CurrentSize; asyncRequest.UserResult = asyncRequest.CurrentSize;
return AsyncOperationStatus.Complete; return AsyncOperationStatus.Complete;
} }

View File

@ -1 +1 @@
e1e9686ed7784f6a16ea693a569012bf15888449 6bbc3c03d2cb117b010f43a89db6683af9ceb8f6

View File

@ -824,7 +824,7 @@ EXTRA_DIST = TestDriver.cs \
Makefile.am.in Makefile.am.in
version.h: Makefile version.h: Makefile
echo "#define FULL_VERSION \"Stable 4.6.1.3/abb06f1\"" > version.h echo "#define FULL_VERSION \"Stable 4.6.1.5/ef43c15\"" > version.h
# Utility target for patching libtool to speed up linking # Utility target for patching libtool to speed up linking
patch-libtool: patch-libtool:

View File

@ -824,7 +824,7 @@ EXTRA_DIST = TestDriver.cs \
Makefile.am.in Makefile.am.in
version.h: Makefile version.h: Makefile
echo "#define FULL_VERSION \"Stable 4.6.1.3/abb06f1\"" > version.h echo "#define FULL_VERSION \"Stable 4.6.1.5/ef43c15\"" > version.h
# Utility target for patching libtool to speed up linking # Utility target for patching libtool to speed up linking
patch-libtool: patch-libtool:

View File

@ -1 +1 @@
906197df9f69b49f888b78629651ab70ec983eaf af57916ed7a1e484a212d0ac404d689861bcb022

View File

@ -1 +1 @@
#define FULL_VERSION "Stable 4.6.1.3/abb06f1" #define FULL_VERSION "Stable 4.6.1.5/ef43c15"

Binary file not shown.

View File

@ -1 +1 @@
8440bded44bc0320b80d941464dc88082c9fc152 5e4e19f077ff0b739d21c49cb7d12f01406323f0

Binary file not shown.

View File

@ -1 +1 @@
ff26f00339a484b537285682fe56c4a828b3da2a bc163f403dc4484be068e049bd90467d235957fd

Binary file not shown.

View File

@ -1 +1 @@
40d73f201b4597e8a20a26bb7134cafb96ffb9bf 180d9e14490b61253133b79b59798a3bda578368

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: mono 4.6.1\n" "Project-Id-Version: mono 4.6.1\n"
"Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n" "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
"POT-Creation-Date: 2016-09-28 11:40+0000\n" "POT-Creation-Date: 2016-10-11 13:11+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

Binary file not shown.

View File

@ -1 +1 @@
740c11c139617ffbd21ab7a6a39ae82f22019014 faaa44720891d4d758b7b091b9b95ccf4243e9db