"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mcs/class/System.Net.Http/System.Net.Http/HttpClient.android.cs" between
mono-6.8.0.105.tar.xz and mono-6.8.0.123.tar.xz

About:

HttpClient.android.cs  (mono-6.8.0.105.tar.xz):HttpClient.android.cs  (mono-6.8.0.123.tar.xz)
using System; using System;
using System.Reflection; using System.Reflection;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace System.Net.Http { namespace System.Net.Http {
public partial class HttpClient { public partial class HttpClient {
static HttpMessageHandler CreateDefaultHandler () static HttpMessageHandler CreateDefaultHandler ()
{ {
Type type = Type.GetType("Android.Runtime.AndroidEnvironm string envvar = Environment.GetEnvironmentVariable ("XA_H
ent, Mono.Android"); TTP_CLIENT_HANDLER_TYPE")?.Trim ();
if (type == null)
return GetFallback ("Invalid Mono.Android assembl if (string.IsNullOrEmpty (envvar))
y? Cannot find Android.Runtime.AndroidEnvironment"); return new HttpClientHandler ();
MethodInfo method = type.GetMethod ("GetHttpMessageHandle if (envvar?.StartsWith ("System.Net.Http.MonoWebRequestHa
r", BindingFlags.Static | BindingFlags.NonPublic); ndler", StringComparison.InvariantCulture) == true)
if (method == null) {
return GetFallback ("Your Xamarin.Android version Type monoWrhType = Type.GetType (envvar, false);
does not support obtaining of the custom HttpClientHandler"); if (monoWrhType != null)
return new HttpClientHandler ((IMonoHttpC
object ret = method.Invoke (null, null); lientHandler) Activator.CreateInstance (monoWrhType));
if (ret == null)
return GetFallback ("Xamarin.Android returned no return new HttpClientHandler ();
custom HttpClientHandler"); }
var handler = ret as HttpMessageHandler; Type handlerType = Type.GetType (envvar, false);
if (handler == null) if (handlerType == null && !envvar.Contains (", "))
return GetFallback ($"{ret?.GetType()} is not a v {
alid HttpMessageHandler"); // if assembly was not specified - look for it in
return handler; Mono.Android too
} // (e.g. AndroidHttpHandler is there)
handlerType = Type.GetType (envvar + ", Mono.Andr
oid", false);
}
if (handlerType == null)
return new HttpClientHandler ();
if (Activator.CreateInstance (handlerType) is HttpMessage
Handler msgHandler)
return msgHandler;
static HttpMessageHandler GetFallback (string message)
{
Console.WriteLine (message + ". Defaulting to System.Net.
Http.HttpClientHandler");
return new HttpClientHandler (); return new HttpClientHandler ();
} }
} }
} }
 End of changes. 2 change blocks. 
27 lines changed or deleted 33 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)