Adding AddXmlRpcHandler(name, method, bool) to selectively disable
KeepAlive for certain XmlRpc handlers. Making use of new AddXmlRpcHandler method in RemoteAdminPlugin to avoid clients waiting indefinitely for response. taking note of BaseHttpServer parameter in CommunicationsManager constructor (was passed it but then just ignored so far).0.6.0-stable
parent
dbd8e1edb5
commit
b91857b8f7
|
@ -85,20 +85,20 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
m_app = openSim;
|
m_app = openSim;
|
||||||
m_httpd = openSim.HttpServer;
|
m_httpd = openSim.HttpServer;
|
||||||
|
|
||||||
m_httpd.AddXmlRPCHandler("admin_create_region", XmlRpcCreateRegionMethod);
|
m_httpd.AddXmlRPCHandler("admin_create_region", XmlRpcCreateRegionMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_delete_region", XmlRpcDeleteRegionMethod);
|
m_httpd.AddXmlRPCHandler("admin_delete_region", XmlRpcDeleteRegionMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_shutdown", XmlRpcShutdownMethod);
|
m_httpd.AddXmlRPCHandler("admin_shutdown", XmlRpcShutdownMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod);
|
m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod);
|
m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod);
|
m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_create_user", XmlRpcCreateUserMethod);
|
m_httpd.AddXmlRPCHandler("admin_create_user", XmlRpcCreateUserMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_exists_user", XmlRpcUserExistsMethod);
|
m_httpd.AddXmlRPCHandler("admin_exists_user", XmlRpcUserExistsMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_update_user", XmlRpcUpdateUserAccountMethod);
|
m_httpd.AddXmlRPCHandler("admin_update_user", XmlRpcUpdateUserAccountMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_load_xml", XmlRpcLoadXMLMethod);
|
m_httpd.AddXmlRPCHandler("admin_load_xml", XmlRpcLoadXMLMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_save_xml", XmlRpcSaveXMLMethod);
|
m_httpd.AddXmlRPCHandler("admin_save_xml", XmlRpcSaveXMLMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_load_oar", XmlRpcLoadOARMethod);
|
m_httpd.AddXmlRPCHandler("admin_load_oar", XmlRpcLoadOARMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_save_oar", XmlRpcSaveOARMethod);
|
m_httpd.AddXmlRPCHandler("admin_save_oar", XmlRpcSaveOARMethod, false);
|
||||||
m_httpd.AddXmlRPCHandler("admin_region_query", XmlRpcRegionQueryMethod);
|
m_httpd.AddXmlRPCHandler("admin_region_query", XmlRpcRegionQueryMethod, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (NullReferenceException)
|
catch (NullReferenceException)
|
||||||
|
|
|
@ -104,6 +104,13 @@ namespace OpenSim.Framework.Communications
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected IUserServiceAdmin m_userServiceAdmin;
|
protected IUserServiceAdmin m_userServiceAdmin;
|
||||||
|
|
||||||
|
|
||||||
|
public BaseHttpServer HttpServer
|
||||||
|
{
|
||||||
|
get { return m_httpServer; }
|
||||||
|
}
|
||||||
|
protected BaseHttpServer m_httpServer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -117,6 +124,7 @@ namespace OpenSim.Framework.Communications
|
||||||
m_networkServersInfo = serversInfo;
|
m_networkServersInfo = serversInfo;
|
||||||
m_assetCache = assetCache;
|
m_assetCache = assetCache;
|
||||||
m_userProfileCacheService = new UserProfileCacheService(this, libraryRootFolder);
|
m_userProfileCacheService = new UserProfileCacheService(this, libraryRootFolder);
|
||||||
|
m_httpServer = httpServer;
|
||||||
// m_transactionsManager = new AgentAssetTransactionsManager(this, dumpAssetsToFile);
|
// m_transactionsManager = new AgentAssetTransactionsManager(this, dumpAssetsToFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ namespace OpenSim.Framework.Servers
|
||||||
protected HttpListener m_httpListener;
|
protected HttpListener m_httpListener;
|
||||||
protected CoolHTTPListener m_httpListener2;
|
protected CoolHTTPListener m_httpListener2;
|
||||||
protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>();
|
protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>();
|
||||||
|
protected Dictionary<string, bool> m_rpcHandlersKeepAlive = new Dictionary<string, bool>();
|
||||||
protected DefaultLLSDMethod m_defaultLlsdHandler = null; // <-- Moving away from the monolithic.. and going to /registered/
|
protected DefaultLLSDMethod m_defaultLlsdHandler = null; // <-- Moving away from the monolithic.. and going to /registered/
|
||||||
protected Dictionary<string, LLSDMethod> m_llsdHandlers = new Dictionary<string, LLSDMethod>();
|
protected Dictionary<string, LLSDMethod> m_llsdHandlers = new Dictionary<string, LLSDMethod>();
|
||||||
protected Dictionary<string, IRequestHandler> m_streamHandlers = new Dictionary<string, IRequestHandler>();
|
protected Dictionary<string, IRequestHandler> m_streamHandlers = new Dictionary<string, IRequestHandler>();
|
||||||
|
@ -141,6 +142,17 @@ namespace OpenSim.Framework.Servers
|
||||||
lock (m_rpcHandlers)
|
lock (m_rpcHandlers)
|
||||||
{
|
{
|
||||||
m_rpcHandlers[method] = handler;
|
m_rpcHandlers[method] = handler;
|
||||||
|
m_rpcHandlersKeepAlive[method] = true; // default
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool AddXmlRPCHandler(string method, XmlRpcMethod handler, bool keepAlive)
|
||||||
|
{
|
||||||
|
lock (m_rpcHandlers)
|
||||||
|
{
|
||||||
|
m_rpcHandlers[method] = handler;
|
||||||
|
m_rpcHandlersKeepAlive[method] = keepAlive; // default
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -584,6 +596,7 @@ namespace OpenSim.Framework.Servers
|
||||||
}
|
}
|
||||||
|
|
||||||
responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse);
|
responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse);
|
||||||
|
response.KeepAlive = m_rpcHandlersKeepAlive[methodName];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue