mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Merge branch 'avination' into careminster
Conflicts: OpenSim/Data/MySQL/MySQLSimulationData.cs
This commit is contained in:
@@ -29,6 +29,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
|
||||
using Nini.Config;
|
||||
using log4net;
|
||||
@@ -70,6 +71,8 @@ namespace OpenSim.Server.Handlers.MapImage
|
||||
|
||||
class MapServerGetHandler : BaseStreamHandler
|
||||
{
|
||||
public static ManualResetEvent ev = new ManualResetEvent(true);
|
||||
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IMapImageService m_MapService;
|
||||
@@ -82,8 +85,13 @@ namespace OpenSim.Server.Handlers.MapImage
|
||||
|
||||
public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
byte[] result = new byte[0];
|
||||
ev.WaitOne();
|
||||
lock (ev)
|
||||
{
|
||||
ev.Reset();
|
||||
}
|
||||
|
||||
byte[] result = new byte[0];
|
||||
string format = string.Empty;
|
||||
result = m_MapService.GetMapTile(path.Trim('/'), out format);
|
||||
if (result.Length > 0)
|
||||
@@ -100,6 +108,11 @@ namespace OpenSim.Server.Handlers.MapImage
|
||||
httpResponse.ContentType = "text/plain";
|
||||
}
|
||||
|
||||
lock (ev)
|
||||
{
|
||||
ev.Set();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user