Merge branch 'upstream'

Former-commit-id: 3fc2ef5f76f3bccd06f6416445ecb17f0f2ea318
This commit is contained in:
Xamarin Public Jenkins (auto-signing) 2019-06-14 09:09:19 +00:00
commit f974da9501
52 changed files with 68 additions and 39 deletions

View File

@ -1 +1 @@
bfddb03c995a54a8367cd96b232d2c10364544db
32032351f05623ddf476bdcb57a30b529b3d2e8d

View File

@ -1 +1 @@
2b32e12835f376e47158033368c4a732d55a5047
19a2e7c59e1e46b86ca76d5200cbc4328a92171a

View File

@ -41,7 +41,7 @@ static partial class Consts
// Use these assembly version constants to make code more maintainable.
//
public const string MonoVersion = "6.0.0.299";
public const string MonoVersion = "6.0.0.300";
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";

View File

@ -188,6 +188,12 @@ namespace System.Net.Http
public IDictionary<string, object> Properties => _delegatingHandler.Properties;
// Only used in MonoWebRequestHandler and ignored by the other handlers.
internal void SetWebRequestTimeout (TimeSpan timeout)
{
_delegatingHandler.SetWebRequestTimeout (timeout);
}
protected internal override Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken) =>
_delegatingHandler.SendAsync (request, cancellationToken);
}

View File

@ -78,5 +78,8 @@ namespace System.Net.Http
}
Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken);
// Only used by MonoWebRequestHandler and ignored by the other handlers.
void SetWebRequestTimeout (TimeSpan timeout);
}
}

View File

@ -67,6 +67,7 @@ namespace System.Net.Http
bool unsafeAuthenticatedConnectionSharing;
bool sentRequest;
string connectionGroupName;
TimeSpan? timeout;
bool disposed;
internal MonoWebRequestHandler ()
@ -368,6 +369,9 @@ namespace System.Net.Http
wr.ServicePoint.Expect100Continue = request.Headers.ExpectContinue == true;
if (timeout != null)
wr.Timeout = (int)timeout.Value.TotalMilliseconds;
// Add request headers
var headers = wr.Headers;
foreach (var header in request.Headers) {
@ -533,5 +537,10 @@ namespace System.Net.Http
throw new NotImplementedException ();
}
}
void IMonoHttpClientHandler.SetWebRequestTimeout (TimeSpan timeout)
{
this.timeout = timeout;
}
}
}

View File

@ -269,6 +269,9 @@ namespace System.Net.Http
async Task<HttpResponseMessage> SendAsyncWorker (HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
{
using (var lcts = CancellationTokenSource.CreateLinkedTokenSource (cts.Token, cancellationToken)) {
// Hack to pass the timeout to the HttpWebRequest that's created by MonoWebRequestHandler; all other handlers ignore this.
if (handler is HttpClientHandler clientHandler)
clientHandler.SetWebRequestTimeout (timeout);
lcts.CancelAfter (timeout);
var task = base.SendAsync (request, lcts.Token);

View File

@ -169,5 +169,8 @@ namespace System.Net.Http
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
// Only used in MonoWebRequestHandler and ignored by the other handlers.
internal void SetWebRequestTimeout (TimeSpan timeout) => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
}

View File

@ -33,7 +33,7 @@ namespace System.Net.Http
{
public class HttpMessageInvoker : IDisposable
{
HttpMessageHandler handler;
protected private HttpMessageHandler handler;
readonly bool disposeHandler;
public HttpMessageInvoker (HttpMessageHandler handler)

View File

@ -40,6 +40,11 @@ namespace System.Net.Http
}
}
// This is only used by MonoWebRequestHandler.
void IMonoHttpClientHandler.SetWebRequestTimeout (TimeSpan timeout)
{
}
Task<HttpResponseMessage> IMonoHttpClientHandler.SendAsync (HttpRequestMessage request, CancellationToken cancellationToken) => SendAsync (request, cancellationToken);
}
}

View File

@ -1 +1 @@
8819bfc5318a074dcb1a11cd1ce8404e35920142
610f149d02b43843d60ea943b1dbda131da50857

View File

@ -1 +1 @@
8135c87708bb0e6972b341ed4dcf542c8c5d38b5
ac5a904a97698ca709eefcd4adf1163eb0018487

View File

@ -1 +1 @@
692db1871a0f948ec05d95e07e58d1adddfbecf1
ef3898ec0a1a2fb4899d555333cf761c9d5ec07e

View File

@ -1 +1 @@
2182f88cde39994cb80a1c0ba96d000b36ae677c
fc7585fb16e851b662b878b39f8e32d3018fd668

View File

@ -1 +1 @@
21f452516f31f530997437d1d43a960d20dac2e8
e393df6726ee3ea4e5f940dbb797c5f6d65cbdab

View File

@ -1 +1 @@
33a72ca489db0746e188e3669710a57cdc45784b
ba75dd4ee877c8ff21c4dbc8dc2f4ff9684ccee3

View File

@ -1 +1 @@
a52112a39f56dfda49caef9f0da0c495b036bce0
921d504a42685c599326466181ff27a39e20ad8e

View File

@ -1 +1 @@
8819bfc5318a074dcb1a11cd1ce8404e35920142
610f149d02b43843d60ea943b1dbda131da50857

View File

@ -1 +1 @@
8135c87708bb0e6972b341ed4dcf542c8c5d38b5
ac5a904a97698ca709eefcd4adf1163eb0018487

Some files were not shown because too many files have changed in this diff Show More