aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorUbitUmarov2017-05-25 10:23:52 +0100
committerUbitUmarov2017-05-25 10:23:52 +0100
commit27779953315e160067080b6f17945ab54695d63f (patch)
tree36e66eeaf84fd48382ab89278c7b150723a45235 /OpenSim/Services
parent merge master (diff)
parentadd some checks for valid endpoints (diff)
downloadopensim-SC-27779953315e160067080b6f17945ab54695d63f.zip
opensim-SC-27779953315e160067080b6f17945ab54695d63f.tar.gz
opensim-SC-27779953315e160067080b6f17945ab54695d63f.tar.bz2
opensim-SC-27779953315e160067080b6f17945ab54695d63f.tar.xz
Merge branch 'master' into httptests
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs12
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs40
2 files changed, 16 insertions, 36 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index 810da2f..2deb2d1 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
@@ -135,8 +135,7 @@ namespace OpenSim.Services.Connectors
135 135
136 for (int i = 0 ; i < 2 ; i++) 136 for (int i = 0 ; i < 2 ; i++)
137 { 137 {
138 m_fetchThreads[i] = new Thread(AssetRequestProcessor); 138 Util.FireAndForget(delegate { AssetRequestProcessor();});
139 m_fetchThreads[i].Start();
140 } 139 }
141 } 140 }
142 141
@@ -349,8 +348,8 @@ namespace OpenSim.Services.Connectors
349 public string id; 348 public string id;
350 } 349 }
351 350
352 private OpenMetaverse.BlockingQueue<QueuedAssetRequest> m_requestQueue = 351 private OpenSim.Framework.BlockingQueue<QueuedAssetRequest> m_requestQueue =
353 new OpenMetaverse.BlockingQueue<QueuedAssetRequest>(); 352 new OpenSim.Framework.BlockingQueue<QueuedAssetRequest>();
354 353
355 private void AssetRequestProcessor() 354 private void AssetRequestProcessor()
356 { 355 {
@@ -358,8 +357,9 @@ namespace OpenSim.Services.Connectors
358 357
359 while (true) 358 while (true)
360 { 359 {
361 r = m_requestQueue.Dequeue(); 360 r = m_requestQueue.Dequeue(2000);
362 361 if(r== null)
362 continue;
363 string uri = r.uri; 363 string uri = r.uri;
364 string id = r.id; 364 string id = r.id;
365 365
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
271 m_serverURI = string.Empty; 271 m_serverURI = string.Empty;
272 } 272 }
273 273
274 /*
275 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri)
276 {
277 m_regionLocX = regionLocX;
278 m_regionLocY = regionLocY;
279 RegionSizeX = (int)Constants.RegionSize;
280 RegionSizeY = (int)Constants.RegionSize;
281
282 m_internalEndPoint = internalEndPoint;
283 m_externalHostName = externalUri;
284 }
285
286 public GridRegion(int regionLocX, int regionLocY, string externalUri, uint port)
287 {
288 m_regionLocX = regionLocX;
289 m_regionLocY = regionLocY;
290 RegionSizeX = (int)Constants.RegionSize;
291 RegionSizeY = (int)Constants.RegionSize;
292
293 m_externalHostName = externalUri;
294
295 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port);
296 }
297 */
298
299 public GridRegion(uint xcell, uint ycell) 274 public GridRegion(uint xcell, uint ycell)
300 { 275 {
301 m_regionLocX = (int)Util.RegionToWorldLoc(xcell); 276 m_regionLocX = (int)Util.RegionToWorldLoc(xcell);
@@ -489,14 +464,16 @@ namespace OpenSim.Services.Interfaces
489 { 464 {
490 get 465 get
491 { 466 {
492 // Old one defaults to IPv6
493 //return new IPEndPoint(Dns.GetHostAddresses(m_externalHostName)[0], m_internalEndPoint.Port);
494
495 IPAddress ia = null; 467 IPAddress ia = null;
496 // If it is already an IP, don't resolve it - just return directly 468 // If it is already an IP, don't resolve it - just return directly
469 // we should not need this
497 if (IPAddress.TryParse(m_externalHostName, out ia)) 470 if (IPAddress.TryParse(m_externalHostName, out ia))
471 {
472 if (ia.Equals(IPAddress.Any) || ia.Equals(IPAddress.IPv6Any))
473 return null;
498 return new IPEndPoint(ia, m_internalEndPoint.Port); 474 return new IPEndPoint(ia, m_internalEndPoint.Port);
499 475 }
476
500 // Reset for next check 477 // Reset for next check
501 ia = null; 478 ia = null;
502 try 479 try
@@ -513,7 +490,7 @@ namespace OpenSim.Services.Interfaces
513 } 490 }
514 } 491 }
515 } 492 }
516 catch (SocketException e) 493 catch // (SocketException e)
517 { 494 {
518 /*throw new Exception( 495 /*throw new Exception(
519 "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + 496 "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
@@ -524,6 +501,9 @@ namespace OpenSim.Services.Interfaces
524 return null; 501 return null;
525 } 502 }
526 503
504 if(ia == null)
505 return null;
506
527 return new IPEndPoint(ia, m_internalEndPoint.Port); 507 return new IPEndPoint(ia, m_internalEndPoint.Port);
528 } 508 }
529 } 509 }