diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index a26a5f0..0f05e07 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -165,7 +165,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
165 | regionimage = regionimage.Replace("-", ""); | 165 | regionimage = regionimage.Replace("-", ""); |
166 | m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "index.php?method=" + regionimage); | 166 | m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "index.php?method=" + regionimage); |
167 | 167 | ||
168 | MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage); | 168 | MainServer.Instance.AddHTTPHandler(regionimage, |
169 | new GenericHTTPDOSProtector(OnHTTPGetMapImage, OnHTTPThrottled, new BasicDosProtectorOptions() | ||
170 | { | ||
171 | AllowXForwardedFor = false, | ||
172 | ForgetTimeSpan = TimeSpan.FromMinutes(2), | ||
173 | MaxRequestsInTimeframe = 4, | ||
174 | ReportingName = "MAPDOSPROTECTOR", | ||
175 | RequestTimeSpan = TimeSpan.FromSeconds(10), | ||
176 | ThrottledAction = ThrottleAction.DoThrottledMethod | ||
177 | }).Process); | ||
169 | MainServer.Instance.AddLLSDHandler( | 178 | MainServer.Instance.AddLLSDHandler( |
170 | "/MAP/MapItems/" + m_scene.RegionInfo.RegionHandle.ToString(), HandleRemoteMapItemRequest); | 179 | "/MAP/MapItems/" + m_scene.RegionInfo.RegionHandle.ToString(), HandleRemoteMapItemRequest); |
171 | 180 | ||
@@ -1081,6 +1090,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1081 | block.Y = (ushort)(r.RegionLocY / Constants.RegionSize); | 1090 | block.Y = (ushort)(r.RegionLocY / Constants.RegionSize); |
1082 | } | 1091 | } |
1083 | 1092 | ||
1093 | public Hashtable OnHTTPThrottled(Hashtable keysvals) | ||
1094 | { | ||
1095 | Hashtable reply = new Hashtable(); | ||
1096 | int statuscode = 500; | ||
1097 | reply["str_response_string"] = "I blocked you! HAHAHAHAHAHAHHAHAH"; | ||
1098 | reply["int_response_code"] = statuscode; | ||
1099 | reply["content_type"] = "text/plain"; | ||
1100 | return reply; | ||
1101 | } | ||
1102 | |||
1084 | public Hashtable OnHTTPGetMapImage(Hashtable keysvals) | 1103 | public Hashtable OnHTTPGetMapImage(Hashtable keysvals) |
1085 | { | 1104 | { |
1086 | m_log.Debug("[WORLD MAP]: Sending map image jpeg"); | 1105 | m_log.Debug("[WORLD MAP]: Sending map image jpeg"); |