From e3f2cfa1ca8dab6e4e901fb2dbcc200131751aed Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Mon, 18 May 2009 10:04:28 +0000 Subject: From: Alan Webb Fixes: [1] Sharing exception on remote OAR management [2] Occasional 505 error talking to Tomcat [3] Occasional mono aborts caused by mlog in the script engine's app domain (mono 2.4) --- .../RemoteController/RemoteAdminPlugin.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 9a25faa..9ed00e6 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -33,6 +33,7 @@ using System.Xml; using System.Net; using System.Reflection; using System.Timers; +using System.Threading; using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -57,6 +58,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController private static bool daload = false; private static Object rslock = new Object(); + private static Object SOLock = new Object(); private OpenSimBase m_app; private BaseHttpServer m_httpd; @@ -367,7 +369,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController }); // Perform shutdown - Timer shutdownTimer = new Timer(timeout); // Wait before firing + System.Timers.Timer shutdownTimer = new System.Timers.Timer(timeout); // Wait before firing shutdownTimer.AutoReset = false; shutdownTimer.Elapsed += new ElapsedEventHandler(shutdownTimer_Elapsed); shutdownTimer.Start(); @@ -1843,14 +1845,23 @@ namespace OpenSim.ApplicationPlugins.RemoteController else throw new Exception("neither region_name nor region_uuid given"); IRegionArchiverModule archiver = scene.RequestModuleInterface(); + + if (archiver != null) + { + scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted; archiver.ArchiveRegion(filename); + lock(SOLock) Monitor.Wait(SOLock,5000); + scene.EventManager.OnOarFileSaved -= RemoteAdminOarSaveCompleted; + } else throw new Exception("Archiver module not present for scene"); + responseData["saved"] = true; response.Value = responseData; + } catch (Exception e) { @@ -1867,6 +1878,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController return response; } + private void RemoteAdminOarSaveCompleted(Guid uuid, string name) + { + m_log.DebugFormat("[RADMIN] File processing complete for {0}", name); + lock(SOLock) Monitor.Pulse(SOLock); + } + public XmlRpcResponse XmlRpcLoadXMLMethod(XmlRpcRequest request) { m_log.Info("[RADMIN]: Received Load XML Administrator Request"); -- cgit v1.1