fix NeighbourHandler

This commit is contained in:
UbitUmarov
2021-12-18 10:44:43 +00:00
parent f4db2813e4
commit eaadb889d5
4 changed files with 16 additions and 17 deletions

View File

@@ -40,7 +40,7 @@ namespace OpenSim.Server.Handlers.Base
/// <summary>
/// Extract the param from an uri.
/// </summary>
/// <param name="uri">Something like this: /uuid/ or /uuid/handle/release</param>
/// <param name="uri">Something like this: /xxxx/uuid/ or /uuid/handle/release</param>
/// <param name="uri">uuid on uuid field</param>
/// <param name="action">optional action</param>
public static bool GetParams(string path, out UUID uuid, out ulong regionHandle, out string action)
@@ -57,13 +57,13 @@ namespace OpenSim.Server.Handlers.Base
}
else
{
if (!UUID.TryParse(parts[0], out uuid))
if (!UUID.TryParse(parts[1], out uuid))
return false;
if (parts.Length >= 2)
UInt64.TryParse(parts[1], out regionHandle);
if (parts.Length >= 3)
action = parts[2];
UInt64.TryParse(parts[2], out regionHandle);
if (parts.Length >= 4)
action = parts[3];
return true;
}

View File

@@ -80,7 +80,7 @@ namespace OpenSim.Server.Handlers.Neighbour
return;
}
if (RestHandlerUtils.GetParams(httpRequest.UriPath, out UUID regionID, out ulong regionHandle, out string action)
if (!RestHandlerUtils.GetParams(httpRequest.UriPath, out UUID regionID, out ulong regionHandle, out string action)
|| regionID == UUID.Zero)
{
m_log.InfoFormat("[RegionPostHandler]: Invalid parameters for neighbour message {0}", httpRequest.UriPath);

View File

@@ -60,7 +60,7 @@ namespace OpenSim.Server.Handlers.Neighbour
//if (authentication)
// m_AuthenticationService = scene.RequestModuleInterface<IAuthenticationService>();
server.AddSimpleStreamHandler(new NeighbourSimpleHandler(m_NeighbourService, m_AuthenticationService));
server.AddSimpleStreamHandler(new NeighbourSimpleHandler(m_NeighbourService, m_AuthenticationService), true);
}
}
}

View File

@@ -96,9 +96,8 @@ namespace OpenSim.Services.Connectors
}
catch (Exception e)
{
m_log.Warn(string.Format(
"[NEIGHBOUR SERVICES CONNECTOR]: PackRegionInfoData failed for HelloNeighbour from {0} to {1}. Exception {2} ",
thisRegion.RegionName, region.RegionName, e.Message), e);
m_log.WarnFormat("[NEIGHBOUR SERVICES CONNECTOR]: PackRegionInfoData failed for HelloNeighbour from {0} to {1}. Exception: {2} ",
thisRegion.RegionName, region.RegionName, e.Message);
return false;
}
@@ -112,9 +111,9 @@ namespace OpenSim.Services.Connectors
}
catch (Exception e)
{
m_log.Warn(string.Format(
"[NEIGHBOUR SERVICES CONNECTOR]: Unable to parse uri {0} to send HelloNeighbour from {1} to {2}. Exception {3} ",
uri, thisRegion.RegionName, region.RegionName, e.Message), e);
m_log.WarnFormat(
"[NEIGHBOUR SERVICES CONNECTOR]: Unable to parse uri {0} to send HelloNeighbour from {1} to {2}. Exception: {3} ",
uri, thisRegion.RegionName, region.RegionName, e.Message);
return false;
}
@@ -150,7 +149,7 @@ namespace OpenSim.Services.Connectors
using (StreamReader sr = new StreamReader(webResponse.GetResponseStream()))
{
sr.ReadToEnd(); // just try to read
//reply = sr.ReadToEnd().Trim();
//string reply = sr.ReadToEnd();
//m_log.InfoFormat("[REST COMMS]: DoHelloNeighbourCall reply was {0} ", reply);
}
}
@@ -158,9 +157,9 @@ namespace OpenSim.Services.Connectors
}
catch (Exception e)
{
m_log.Warn(string.Format(
"[NEIGHBOUR SERVICES CONNECTOR]: Exception on reply of DoHelloNeighbourCall from {0} back to {1}. Exception {2} ",
region.RegionName, thisRegion.RegionName, e.Message), e);
m_log.WarnFormat(
"[NEIGHBOUR SERVICES CONNECTOR]: Exception on reply of DoHelloNeighbourCall from {0} back to {1}. Exception: {2} ",
region.RegionName, thisRegion.RegionName, e.Message);
}
return false;
}