Eradicate ☠ Mono ☠
Co-Authored-By: Gustas <37534529+punkpun@users.noreply.github.com>
This commit is contained in:
@@ -9,9 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
// Not used/usable on Mono. Only used for Dotnet Core.
|
||||
// Based on https://github.com/natemcmaster/DotNetCorePlugins and used under the terms of the Apache 2.0 license
|
||||
#if NET5_0_OR_GREATER
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -362,4 +360,3 @@ namespace OpenRA.Support
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -16,10 +16,8 @@ namespace OpenRA.Support
|
||||
{
|
||||
public static class HttpClientFactory
|
||||
{
|
||||
#if NET5_0_OR_GREATER
|
||||
const int MaxConnectionPerServer = 20;
|
||||
static readonly TimeSpan ConnectionLifeTime = TimeSpan.FromMinutes(1);
|
||||
#endif
|
||||
|
||||
static readonly Lazy<HttpMessageHandler> Handler = new(GetHandler);
|
||||
|
||||
@@ -30,7 +28,6 @@ namespace OpenRA.Support
|
||||
|
||||
static HttpMessageHandler GetHandler()
|
||||
{
|
||||
#if NET5_0_OR_GREATER
|
||||
return new SocketsHttpHandler
|
||||
{
|
||||
// https://github.com/dotnet/corefx/issues/26895
|
||||
@@ -40,9 +37,6 @@ namespace OpenRA.Support
|
||||
PooledConnectionIdleTimeout = ConnectionLifeTime,
|
||||
MaxConnectionsPerServer = MaxConnectionPerServer
|
||||
};
|
||||
#else
|
||||
return new HttpClientHandler();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user