diff options
author | Melanie | 2013-11-03 21:34:36 +0000 |
---|---|---|
committer | Melanie | 2013-11-03 21:34:36 +0000 |
commit | ba203ed94fb9fb27e4da2663dad6cac21d5892e3 (patch) | |
tree | c03981fa7b9070af3cec331234b78762c49a8a06 /OpenSim/Server | |
parent | Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into ... (diff) | |
parent | Add current .NET windows framework requirement to README. (diff) | |
download | opensim-SC_OLD-ba203ed94fb9fb27e4da2663dad6cac21d5892e3.zip opensim-SC_OLD-ba203ed94fb9fb27e4da2663dad6cac21d5892e3.tar.gz opensim-SC_OLD-ba203ed94fb9fb27e4da2663dad6cac21d5892e3.tar.bz2 opensim-SC_OLD-ba203ed94fb9fb27e4da2663dad6cac21d5892e3.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Server')
-rw-r--r-- | OpenSim/Server/Handlers/Login/LLLoginHandlers.cs | 11 | ||||
-rw-r--r-- | OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs | 15 |
2 files changed, 25 insertions, 1 deletions
diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs index e4a0ffa..f2a5678 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs | |||
@@ -145,6 +145,17 @@ namespace OpenSim.Server.Handlers.Login | |||
145 | return FailedXMLRPCResponse(); | 145 | return FailedXMLRPCResponse(); |
146 | 146 | ||
147 | } | 147 | } |
148 | public XmlRpcResponse HandleXMLRPCLoginBlocked(XmlRpcRequest request, IPEndPoint client) | ||
149 | { | ||
150 | XmlRpcResponse response = new XmlRpcResponse(); | ||
151 | Hashtable resp = new Hashtable(); | ||
152 | |||
153 | resp["reason"] = "presence"; | ||
154 | resp["message"] = "Logins are currently restricted. Please try again later."; | ||
155 | resp["login"] = "false"; | ||
156 | response.Value = resp; | ||
157 | return response; | ||
158 | } | ||
148 | 159 | ||
149 | public XmlRpcResponse HandleXMLRPCSetLoginLevel(XmlRpcRequest request, IPEndPoint remoteClient) | 160 | public XmlRpcResponse HandleXMLRPCSetLoginLevel(XmlRpcRequest request, IPEndPoint remoteClient) |
150 | { | 161 | { |
diff --git a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs index 97e8295..f60e892 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs | |||
@@ -44,6 +44,7 @@ namespace OpenSim.Server.Handlers.Login | |||
44 | 44 | ||
45 | private ILoginService m_LoginService; | 45 | private ILoginService m_LoginService; |
46 | private bool m_Proxy; | 46 | private bool m_Proxy; |
47 | private BasicDosProtectorOptions m_DosProtectionOptions; | ||
47 | 48 | ||
48 | public LLLoginServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) : | 49 | public LLLoginServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) : |
49 | base(config, server, String.Empty) | 50 | base(config, server, String.Empty) |
@@ -88,6 +89,16 @@ namespace OpenSim.Server.Handlers.Login | |||
88 | throw new Exception(String.Format("No LocalServiceModule for LoginService in config file")); | 89 | throw new Exception(String.Format("No LocalServiceModule for LoginService in config file")); |
89 | 90 | ||
90 | m_Proxy = serverConfig.GetBoolean("HasProxy", false); | 91 | m_Proxy = serverConfig.GetBoolean("HasProxy", false); |
92 | m_DosProtectionOptions = new BasicDosProtectorOptions(); | ||
93 | // Dos Protection Options | ||
94 | m_DosProtectionOptions.AllowXForwardedFor = serverConfig.GetBoolean("DOSAllowXForwardedForHeader", false); | ||
95 | m_DosProtectionOptions.RequestTimeSpan = | ||
96 | TimeSpan.FromMilliseconds(serverConfig.GetInt("DOSRequestTimeFrameMS", 10000)); | ||
97 | m_DosProtectionOptions.MaxRequestsInTimeframe = serverConfig.GetInt("DOSMaxRequestsInTimeFrame", 5); | ||
98 | m_DosProtectionOptions.ForgetTimeSpan = | ||
99 | TimeSpan.FromMilliseconds(serverConfig.GetInt("DOSForgiveClientAfterMS", 120000)); | ||
100 | m_DosProtectionOptions.ReportingName = "LOGINDOSPROTECTION"; | ||
101 | |||
91 | 102 | ||
92 | return loginService; | 103 | return loginService; |
93 | } | 104 | } |
@@ -95,7 +106,9 @@ namespace OpenSim.Server.Handlers.Login | |||
95 | private void InitializeHandlers(IHttpServer server) | 106 | private void InitializeHandlers(IHttpServer server) |
96 | { | 107 | { |
97 | LLLoginHandlers loginHandlers = new LLLoginHandlers(m_LoginService, m_Proxy); | 108 | LLLoginHandlers loginHandlers = new LLLoginHandlers(m_LoginService, m_Proxy); |
98 | server.AddXmlRPCHandler("login_to_simulator", loginHandlers.HandleXMLRPCLogin, false); | 109 | server.AddXmlRPCHandler("login_to_simulator", |
110 | new XmlRpcBasicDOSProtector(loginHandlers.HandleXMLRPCLogin,loginHandlers.HandleXMLRPCLoginBlocked, | ||
111 | m_DosProtectionOptions).Process, false); | ||
99 | server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false); | 112 | server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false); |
100 | server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin); | 113 | server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin); |
101 | server.AddWebSocketHandler("/WebSocket/GridLogin", loginHandlers.HandleWebSocketLoginEvents); | 114 | server.AddWebSocketHandler("/WebSocket/GridLogin", loginHandlers.HandleWebSocketLoginEvents); |