change share of almost empty class httpclient, to just share of used SocketsHttpHandler, This simpifies handling of timeout, otherwise problematic

This commit is contained in:
UbitUmarov
2023-05-26 20:27:24 +01:00
parent c90858576c
commit e950c502ad
13 changed files with 108 additions and 127 deletions

View File

@@ -55,6 +55,7 @@ using OpenMetaverse;
using OpenMetaverse.StructuredData;
using Amib.Threading;
using System.Collections.Concurrent;
using System.Net.Http;
namespace OpenSim.Framework
{
@@ -2194,6 +2195,7 @@ namespace OpenSim.Framework
return ms;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static XmlRpcResponse XmlRpcCommand(string url, string methodName, params object[] args)
{
return SendXmlRpcCommand(url, methodName, args);
@@ -2201,8 +2203,9 @@ namespace OpenSim.Framework
public static XmlRpcResponse SendXmlRpcCommand(string url, string methodName, object[] args)
{
XmlRpcRequest client = new(methodName, args);
return client.Send(url, WebUtil.SharedHttpClientWithRedir, 6000);
XmlRpcRequest xmlclient = new(methodName, args);
using HttpClient hclient = WebUtil.GetNewGlobalHttpClient(10000);
return xmlclient.Send(url, hclient);
}
/// <summary>