From 9a1d94f455d9efcf5be8c298535470483ccba41e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 25 May 2017 01:28:02 +0100 Subject: remove use of libomv BlockingQueue --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 810da2f..f82b223 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -349,8 +349,8 @@ namespace OpenSim.Services.Connectors public string id; } - private OpenMetaverse.BlockingQueue m_requestQueue = - new OpenMetaverse.BlockingQueue(); + private OpenSim.Framework.BlockingQueue m_requestQueue = + new OpenSim.Framework.BlockingQueue(); private void AssetRequestProcessor() { -- cgit v1.1 From 4286ae43f23eb512e10751de5302cb129a035fcb Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 25 May 2017 01:51:53 +0100 Subject: make some threads background ones --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index f82b223..46cd727 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -136,6 +136,7 @@ namespace OpenSim.Services.Connectors for (int i = 0 ; i < 2 ; i++) { m_fetchThreads[i] = new Thread(AssetRequestProcessor); + m_fetchThreads[i].IsBackground = true; m_fetchThreads[i].Start(); } } -- cgit v1.1 From 65e9421058b3542928df137e3f89c1545d2b657d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 25 May 2017 04:24:23 +0100 Subject: minor changes --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 46cd727..62d13fc 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -359,8 +359,9 @@ namespace OpenSim.Services.Connectors while (true) { - r = m_requestQueue.Dequeue(); - + r = m_requestQueue.Dequeue(2000); + if(r== null) + continue; string uri = r.uri; string id = r.id; -- cgit v1.1 From e5377eb839fe9edecae4063a823ff8bf10768b1c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 25 May 2017 04:51:45 +0100 Subject: use threads from main pool on assetsconnector --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 62d13fc..2deb2d1 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -135,9 +135,7 @@ namespace OpenSim.Services.Connectors for (int i = 0 ; i < 2 ; i++) { - m_fetchThreads[i] = new Thread(AssetRequestProcessor); - m_fetchThreads[i].IsBackground = true; - m_fetchThreads[i].Start(); + Util.FireAndForget(delegate { AssetRequestProcessor();}); } } -- cgit v1.1 From 31b4a3124692a2b73a42bb994a61012d747b830c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 25 May 2017 09:46:29 +0100 Subject: add some checks for valid endpoints --- OpenSim/Services/Interfaces/IGridService.cs | 40 ++++++++--------------------- 1 file changed, 10 insertions(+), 30 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 66e5870..8068ff5 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -271,31 +271,6 @@ namespace OpenSim.Services.Interfaces m_serverURI = string.Empty; } - /* - public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri) - { - m_regionLocX = regionLocX; - m_regionLocY = regionLocY; - RegionSizeX = (int)Constants.RegionSize; - RegionSizeY = (int)Constants.RegionSize; - - m_internalEndPoint = internalEndPoint; - m_externalHostName = externalUri; - } - - public GridRegion(int regionLocX, int regionLocY, string externalUri, uint port) - { - m_regionLocX = regionLocX; - m_regionLocY = regionLocY; - RegionSizeX = (int)Constants.RegionSize; - RegionSizeY = (int)Constants.RegionSize; - - m_externalHostName = externalUri; - - m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port); - } - */ - public GridRegion(uint xcell, uint ycell) { m_regionLocX = (int)Util.RegionToWorldLoc(xcell); @@ -489,14 +464,16 @@ namespace OpenSim.Services.Interfaces { get { - // Old one defaults to IPv6 - //return new IPEndPoint(Dns.GetHostAddresses(m_externalHostName)[0], m_internalEndPoint.Port); - IPAddress ia = null; // If it is already an IP, don't resolve it - just return directly + // we should not need this if (IPAddress.TryParse(m_externalHostName, out ia)) + { + if (ia.Equals(IPAddress.Any) || ia.Equals(IPAddress.IPv6Any)) + return null; return new IPEndPoint(ia, m_internalEndPoint.Port); - + } + // Reset for next check ia = null; try @@ -513,7 +490,7 @@ namespace OpenSim.Services.Interfaces } } } - catch (SocketException e) + catch // (SocketException e) { /*throw new Exception( "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + @@ -524,6 +501,9 @@ namespace OpenSim.Services.Interfaces return null; } + if(ia == null) + return null; + return new IPEndPoint(ia, m_internalEndPoint.Port); } } -- cgit v1.1