diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2 opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz |
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs index 9a7ad34..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) |
@@ -60,8 +61,8 @@ namespace OpenSim.Server.Handlers.Login | |||
60 | InitializeHandlers(server); | 61 | InitializeHandlers(server); |
61 | } | 62 | } |
62 | 63 | ||
63 | public LLLoginServiceInConnector(IConfigSource config, IHttpServer server) : | 64 | public LLLoginServiceInConnector(IConfigSource config, IHttpServer server, string configName) : |
64 | base(config, server, String.Empty) | 65 | base(config, server, configName) |
65 | { | 66 | { |
66 | string loginService = ReadLocalServiceFromConfig(config); | 67 | string loginService = ReadLocalServiceFromConfig(config); |
67 | 68 | ||
@@ -72,6 +73,11 @@ namespace OpenSim.Server.Handlers.Login | |||
72 | InitializeHandlers(server); | 73 | InitializeHandlers(server); |
73 | } | 74 | } |
74 | 75 | ||
76 | public LLLoginServiceInConnector(IConfigSource config, IHttpServer server) : | ||
77 | this(config, server, String.Empty) | ||
78 | { | ||
79 | } | ||
80 | |||
75 | private string ReadLocalServiceFromConfig(IConfigSource config) | 81 | private string ReadLocalServiceFromConfig(IConfigSource config) |
76 | { | 82 | { |
77 | IConfig serverConfig = config.Configs["LoginService"]; | 83 | IConfig serverConfig = config.Configs["LoginService"]; |
@@ -83,6 +89,16 @@ namespace OpenSim.Server.Handlers.Login | |||
83 | 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")); |
84 | 90 | ||
85 | 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 | |||
86 | 102 | ||
87 | return loginService; | 103 | return loginService; |
88 | } | 104 | } |
@@ -90,9 +106,12 @@ namespace OpenSim.Server.Handlers.Login | |||
90 | private void InitializeHandlers(IHttpServer server) | 106 | private void InitializeHandlers(IHttpServer server) |
91 | { | 107 | { |
92 | LLLoginHandlers loginHandlers = new LLLoginHandlers(m_LoginService, m_Proxy); | 108 | LLLoginHandlers loginHandlers = new LLLoginHandlers(m_LoginService, m_Proxy); |
93 | 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); | ||
94 | server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false); | 112 | server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false); |
95 | server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin); | 113 | server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin); |
114 | server.AddWebSocketHandler("/WebSocket/GridLogin", loginHandlers.HandleWebSocketLoginEvents); | ||
96 | } | 115 | } |
97 | } | 116 | } |
98 | } | 117 | } |