aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Handlers/Map/MapGetServerConnector.cs')
-rw-r--r--OpenSim/Server/Handlers/Map/MapGetServerConnector.cs28
1 files changed, 26 insertions, 2 deletions
diff --git a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs
index 7bb2f39..1ae669c 100644
--- a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs
@@ -29,6 +29,7 @@ using System;
29using System.IO; 29using System.IO;
30using System.Net; 30using System.Net;
31using System.Reflection; 31using System.Reflection;
32using System.Threading;
32 33
33using Nini.Config; 34using Nini.Config;
34using log4net; 35using log4net;
@@ -37,6 +38,7 @@ using OpenSim.Server.Base;
37using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
38using OpenSim.Framework.Servers.HttpServer; 39using OpenSim.Framework.Servers.HttpServer;
39using OpenSim.Server.Handlers.Base; 40using OpenSim.Server.Handlers.Base;
41using OpenMetaverse;
40 42
41namespace OpenSim.Server.Handlers.MapImage 43namespace OpenSim.Server.Handlers.MapImage
42{ 44{
@@ -70,6 +72,8 @@ namespace OpenSim.Server.Handlers.MapImage
70 72
71 class MapServerGetHandler : BaseStreamHandler 73 class MapServerGetHandler : BaseStreamHandler
72 { 74 {
75 public static ManualResetEvent ev = new ManualResetEvent(true);
76
73// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 77// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
74 78
75 private IMapImageService m_MapService; 79 private IMapImageService m_MapService;
@@ -82,10 +86,25 @@ namespace OpenSim.Server.Handlers.MapImage
82 86
83 protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 87 protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
84 { 88 {
85 byte[] result = new byte[0]; 89 ev.WaitOne();
90 lock (ev)
91 {
92 ev.Reset();
93 }
86 94
95 byte[] result = new byte[0];
87 string format = string.Empty; 96 string format = string.Empty;
88 result = m_MapService.GetMapTile(path.Trim('/'), out format); 97
98// UUID scopeID = new UUID("07f8d88e-cd5e-4239-a0ed-843f75d09992");
99 UUID scopeID = UUID.Zero;
100
101 string[] bits = path.Trim('/').Split(new char[] {'/'});
102 if (bits.Length > 1)
103 {
104 scopeID = new UUID(bits[0]);
105 path = bits[1];
106 }
107 result = m_MapService.GetMapTile(path.Trim('/'), scopeID, out format);
89 if (result.Length > 0) 108 if (result.Length > 0)
90 { 109 {
91 httpResponse.StatusCode = (int)HttpStatusCode.OK; 110 httpResponse.StatusCode = (int)HttpStatusCode.OK;
@@ -100,6 +119,11 @@ namespace OpenSim.Server.Handlers.MapImage
100 httpResponse.ContentType = "text/plain"; 119 httpResponse.ContentType = "text/plain";
101 } 120 }
102 121
122 lock (ev)
123 {
124 ev.Set();
125 }
126
103 return result; 127 return result;
104 } 128 }
105 129