diff options
author | UbitUmarov | 2016-09-05 12:30:25 +0100 |
---|---|---|
committer | UbitUmarov | 2016-09-05 12:30:25 +0100 |
commit | 49c579ec71cf785f1f6f5117446bbca48ccc3911 (patch) | |
tree | ce9a8d59d9afb083e6acf4ffc90c7fe8ee526c44 /OpenSim/Region | |
parent | Fix some wrong handling of booleans for SeeAVs, AnyAVSounds and GroupAVSounds... (diff) | |
download | opensim-SC_OLD-49c579ec71cf785f1f6f5117446bbca48ccc3911.zip opensim-SC_OLD-49c579ec71cf785f1f6f5117446bbca48ccc3911.tar.gz opensim-SC_OLD-49c579ec71cf785f1f6f5117446bbca48ccc3911.tar.bz2 opensim-SC_OLD-49c579ec71cf785f1f6f5117446bbca48ccc3911.tar.xz |
suspend httpdos on mapimge, fix image not been updated after first Get till restart
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 30 |
2 files changed, 24 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index f40541e..1357825 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | |||
@@ -210,7 +210,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
210 | return; | 210 | return; |
211 | } | 211 | } |
212 | 212 | ||
213 | m_log.DebugFormat("{0} Upload maptile for {1}", LogHeader, scene.Name); | ||
214 | 213 | ||
215 | // mapTile.Save( // DEBUG DEBUG | 214 | // mapTile.Save( // DEBUG DEBUG |
216 | // String.Format("maptiles/raw-{0}-{1}-{2}.jpg", regionName, scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY), | 215 | // String.Format("maptiles/raw-{0}-{1}-{2}.jpg", regionName, scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY), |
@@ -218,12 +217,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
218 | // If the region/maptile is legacy sized, just upload the one tile like it has always been done | 217 | // If the region/maptile is legacy sized, just upload the one tile like it has always been done |
219 | if (mapTile.Width == Constants.RegionSize && mapTile.Height == Constants.RegionSize) | 218 | if (mapTile.Width == Constants.RegionSize && mapTile.Height == Constants.RegionSize) |
220 | { | 219 | { |
220 | m_log.DebugFormat("{0} Upload maptile for {1}", LogHeader, scene.Name); | ||
221 | ConvertAndUploadMaptile(scene, mapTile, | 221 | ConvertAndUploadMaptile(scene, mapTile, |
222 | scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, | 222 | scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, |
223 | scene.RegionInfo.RegionName); | 223 | scene.RegionInfo.RegionName); |
224 | } | 224 | } |
225 | else | 225 | else |
226 | { | 226 | { |
227 | m_log.DebugFormat("{0} Upload {1} maptiles for {2}", LogHeader, | ||
228 | (mapTile.Width * mapTile.Height) / (Constants.RegionSize * Constants.RegionSize), | ||
229 | scene.Name); | ||
230 | |||
227 | // For larger regions (varregion) we must cut the region image into legacy sized | 231 | // For larger regions (varregion) we must cut the region image into legacy sized |
228 | // pieces since that is how the maptile system works. | 232 | // pieces since that is how the maptile system works. |
229 | // Note the assumption that varregions are always a multiple of legacy size. | 233 | // Note the assumption that varregions are always a multiple of legacy size. |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 57ec800..c249e9d 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -66,7 +66,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
66 | 66 | ||
67 | private static readonly string DEFAULT_WORLD_MAP_EXPORT_PATH = "exportmap.jpg"; | 67 | private static readonly string DEFAULT_WORLD_MAP_EXPORT_PATH = "exportmap.jpg"; |
68 | private static readonly UUID STOP_UUID = UUID.Random(); | 68 | private static readonly UUID STOP_UUID = UUID.Random(); |
69 | private static readonly string m_mapLayerPath = "0001/"; | ||
70 | 69 | ||
71 | private OpenSim.Framework.BlockingQueue<MapRequestState> requests = new OpenSim.Framework.BlockingQueue<MapRequestState>(); | 70 | private OpenSim.Framework.BlockingQueue<MapRequestState> requests = new OpenSim.Framework.BlockingQueue<MapRequestState>(); |
72 | 71 | ||
@@ -177,6 +176,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
177 | regionimage = regionimage.Replace("-", ""); | 176 | regionimage = regionimage.Replace("-", ""); |
178 | m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "index.php?method=" + regionimage); | 177 | m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "index.php?method=" + regionimage); |
179 | 178 | ||
179 | /* | ||
180 | MainServer.Instance.AddHTTPHandler(regionimage, | 180 | MainServer.Instance.AddHTTPHandler(regionimage, |
181 | new GenericHTTPDOSProtector(OnHTTPGetMapImage, OnHTTPThrottled, new BasicDosProtectorOptions() | 181 | new GenericHTTPDOSProtector(OnHTTPGetMapImage, OnHTTPThrottled, new BasicDosProtectorOptions() |
182 | { | 182 | { |
@@ -187,6 +187,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
187 | RequestTimeSpan = TimeSpan.FromSeconds(10), | 187 | RequestTimeSpan = TimeSpan.FromSeconds(10), |
188 | ThrottledAction = BasicDOSProtector.ThrottleAction.DoThrottledMethod | 188 | ThrottledAction = BasicDOSProtector.ThrottleAction.DoThrottledMethod |
189 | }).Process); | 189 | }).Process); |
190 | */ | ||
191 | |||
192 | MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage); | ||
190 | MainServer.Instance.AddLLSDHandler( | 193 | MainServer.Instance.AddLLSDHandler( |
191 | "/MAP/MapItems/" + m_scene.RegionInfo.RegionHandle.ToString(), HandleRemoteMapItemRequest); | 194 | "/MAP/MapItems/" + m_scene.RegionInfo.RegionHandle.ToString(), HandleRemoteMapItemRequest); |
192 | 195 | ||
@@ -222,12 +225,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
222 | public void OnRegisterCaps(UUID agentID, Caps caps) | 225 | public void OnRegisterCaps(UUID agentID, Caps caps) |
223 | { | 226 | { |
224 | //m_log.DebugFormat("[WORLD MAP]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); | 227 | //m_log.DebugFormat("[WORLD MAP]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); |
225 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | 228 | string capspath = "/CAPS/" + UUID.Random(); |
226 | caps.RegisterHandler( | 229 | caps.RegisterHandler( |
227 | "MapLayer", | 230 | "MapLayer", |
228 | new RestStreamHandler( | 231 | new RestStreamHandler( |
229 | "POST", | 232 | "POST", |
230 | capsBase + m_mapLayerPath, | 233 | capspath, |
231 | (request, path, param, httpRequest, httpResponse) | 234 | (request, path, param, httpRequest, httpResponse) |
232 | => MapLayerRequest(request, path, param, agentID, caps), | 235 | => MapLayerRequest(request, path, param, agentID, caps), |
233 | "MapLayer", | 236 | "MapLayer", |
@@ -1142,10 +1145,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1142 | 1145 | ||
1143 | protected void MapBlockSendThread() | 1146 | protected void MapBlockSendThread() |
1144 | { | 1147 | { |
1148 | List<MapBlockRequestData> thisRunData = new List<MapBlockRequestData>(); | ||
1145 | while (true) | 1149 | while (true) |
1146 | { | 1150 | { |
1147 | List<MapBlockRequestData> thisRunData = new List<MapBlockRequestData>(); | ||
1148 | |||
1149 | m_mapBlockRequestEvent.WaitOne(); | 1151 | m_mapBlockRequestEvent.WaitOne(); |
1150 | lock (m_mapBlockRequestEvent) | 1152 | lock (m_mapBlockRequestEvent) |
1151 | { | 1153 | { |
@@ -1162,13 +1164,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1162 | m_mapBlockRequestEvent.Reset(); | 1164 | m_mapBlockRequestEvent.Reset(); |
1163 | } | 1165 | } |
1164 | 1166 | ||
1165 | foreach (MapBlockRequestData req in thisRunData) | 1167 | if(thisRunData.Count > 0) |
1166 | { | 1168 | { |
1167 | // Null client stops thread | 1169 | foreach (MapBlockRequestData req in thisRunData) |
1168 | if (req.client == null) | 1170 | { |
1169 | return; | 1171 | // Null client stops thread |
1172 | if (req.client == null) | ||
1173 | return; | ||
1174 | |||
1175 | GetAndSendBlocksInternal(req.client, req.minX, req.minY, req.maxX, req.maxY, req.flags); | ||
1176 | } | ||
1170 | 1177 | ||
1171 | GetAndSendBlocksInternal(req.client, req.minX, req.minY, req.maxX, req.maxY, req.flags); | 1178 | thisRunData.Clear(); |
1172 | } | 1179 | } |
1173 | 1180 | ||
1174 | Thread.Sleep(50); | 1181 | Thread.Sleep(50); |
@@ -1590,6 +1597,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1590 | { | 1597 | { |
1591 | m_scene.AssetService.Delete(lastID.ToString()); | 1598 | m_scene.AssetService.Delete(lastID.ToString()); |
1592 | m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Zero; | 1599 | m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Zero; |
1600 | myMapImageJPEG = new byte[0]; | ||
1593 | needRegionSave = true; | 1601 | needRegionSave = true; |
1594 | } | 1602 | } |
1595 | 1603 | ||
@@ -1648,7 +1656,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1648 | asset.Flags = AssetFlags.Maptile; | 1656 | asset.Flags = AssetFlags.Maptile; |
1649 | 1657 | ||
1650 | // Store the new one | 1658 | // Store the new one |
1651 | m_log.DebugFormat("[WORLD MAP]: Storing map tile {0} for {1}", asset.ID, m_scene.RegionInfo.RegionName); | 1659 | m_log.DebugFormat("[WORLD MAP]: Storing map image {0} for {1}", asset.ID, m_scene.RegionInfo.RegionName); |
1652 | 1660 | ||
1653 | m_scene.AssetService.Store(asset); | 1661 | m_scene.AssetService.Store(asset); |
1654 | 1662 | ||