mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
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:
@@ -41,6 +41,7 @@ using OpenSim.Region.Framework.Scenes;
|
||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using System.Net.Http;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
{
|
||||
@@ -597,9 +598,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
ArrayList SendParams = new ArrayList();
|
||||
SendParams.Add(xmlrpcdata);
|
||||
XmlRpcRequest GridReq = new XmlRpcRequest("grid_instant_message", SendParams);
|
||||
HttpClient hclient = null;
|
||||
try
|
||||
{
|
||||
XmlRpcResponse GridResp = GridReq.Send(reginfo.ServerURI, WebUtil.SharedHttpClientWithRedir, 6000);
|
||||
hclient = WebUtil.GetNewGlobalHttpClient(10000);
|
||||
XmlRpcResponse GridResp = GridReq.Send(reginfo.ServerURI, hclient);
|
||||
Hashtable responseData = (Hashtable)GridResp.Value;
|
||||
if (responseData.ContainsKey("success"))
|
||||
{
|
||||
@@ -621,6 +624,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
{
|
||||
m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to {0} : {1}", reginfo.ServerURI.ToString(), e.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
hclient?.Dispose();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user