diff options
Diffstat (limited to 'OpenSim/Server/Handlers/Map/MapGetServerConnector.cs')
-rw-r--r-- | OpenSim/Server/Handlers/Map/MapGetServerConnector.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs index fb85d1c..4502b7d 100644 --- a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Net; | 30 | using System.Net; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Threading; | ||
32 | 33 | ||
33 | using Nini.Config; | 34 | using Nini.Config; |
34 | using log4net; | 35 | using log4net; |
@@ -70,6 +71,8 @@ namespace OpenSim.Server.Handlers.MapImage | |||
70 | 71 | ||
71 | class MapServerGetHandler : BaseStreamHandler | 72 | class MapServerGetHandler : BaseStreamHandler |
72 | { | 73 | { |
74 | public static ManualResetEvent ev = new ManualResetEvent(true); | ||
75 | |||
73 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 76 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
74 | 77 | ||
75 | private IMapImageService m_MapService; | 78 | private IMapImageService m_MapService; |
@@ -82,8 +85,13 @@ namespace OpenSim.Server.Handlers.MapImage | |||
82 | 85 | ||
83 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 86 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
84 | { | 87 | { |
85 | byte[] result = new byte[0]; | 88 | ev.WaitOne(); |
89 | lock (ev) | ||
90 | { | ||
91 | ev.Reset(); | ||
92 | } | ||
86 | 93 | ||
94 | byte[] result = new byte[0]; | ||
87 | string format = string.Empty; | 95 | string format = string.Empty; |
88 | result = m_MapService.GetMapTile(path.Trim('/'), out format); | 96 | result = m_MapService.GetMapTile(path.Trim('/'), out format); |
89 | if (result.Length > 0) | 97 | if (result.Length > 0) |
@@ -100,6 +108,11 @@ namespace OpenSim.Server.Handlers.MapImage | |||
100 | httpResponse.ContentType = "text/plain"; | 108 | httpResponse.ContentType = "text/plain"; |
101 | } | 109 | } |
102 | 110 | ||
111 | lock (ev) | ||
112 | { | ||
113 | ev.Set(); | ||
114 | } | ||
115 | |||
103 | return result; | 116 | return result; |
104 | } | 117 | } |
105 | 118 | ||