diff options
author | UbitUmarov | 2018-01-18 04:28:05 +0000 |
---|---|---|
committer | UbitUmarov | 2018-01-18 04:28:05 +0000 |
commit | dd491bba57bcf5042fd5f1bbad28fe5cde8a461b (patch) | |
tree | 7965d236fe500e8507a1485720f2f321f53c0a7a /OpenSim | |
parent | pesty warning (diff) | |
download | opensim-SC-dd491bba57bcf5042fd5f1bbad28fe5cde8a461b.zip opensim-SC-dd491bba57bcf5042fd5f1bbad28fe5cde8a461b.tar.gz opensim-SC-dd491bba57bcf5042fd5f1bbad28fe5cde8a461b.tar.bz2 opensim-SC-dd491bba57bcf5042fd5f1bbad28fe5cde8a461b.tar.xz |
abort uploading large region map tiles as soon one fails
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | 32 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs | 3 |
2 files changed, 21 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index 9888c3b..666e557 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | |||
@@ -244,11 +244,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
244 | (int)Constants.RegionSize, (int)Constants.RegionSize); | 244 | (int)Constants.RegionSize, (int)Constants.RegionSize); |
245 | using (Bitmap subMapTile = mapTile.Clone(rect, mapTile.PixelFormat)) | 245 | using (Bitmap subMapTile = mapTile.Clone(rect, mapTile.PixelFormat)) |
246 | { | 246 | { |
247 | ConvertAndUploadMaptile(scene, subMapTile, | 247 | if(!ConvertAndUploadMaptile(scene, subMapTile, |
248 | scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize), | 248 | scene.RegionInfo.RegionLocX + (xx / Constants.RegionSize), |
249 | scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize), | 249 | scene.RegionInfo.RegionLocY + (yy / Constants.RegionSize), |
250 | scene.Name); | 250 | scene.Name)); |
251 | } | 251 | { |
252 | m_log.DebugFormat("{0} Upload maptileS for {1} aborted!", LogHeader, scene.Name); | ||
253 | return; // abort rest; | ||
254 | } | ||
255 | } | ||
252 | } | 256 | } |
253 | } | 257 | } |
254 | } | 258 | } |
@@ -280,7 +284,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
280 | } | 284 | } |
281 | } | 285 | } |
282 | 286 | ||
283 | private void ConvertAndUploadMaptile(IScene scene, Image tileImage, uint locX, uint locY, string regionName) | 287 | private bool ConvertAndUploadMaptile(IScene scene, Image tileImage, uint locX, uint locY, string regionName) |
284 | { | 288 | { |
285 | byte[] jpgData = Utils.EmptyBytes; | 289 | byte[] jpgData = Utils.EmptyBytes; |
286 | 290 | ||
@@ -289,19 +293,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
289 | tileImage.Save(stream, ImageFormat.Jpeg); | 293 | tileImage.Save(stream, ImageFormat.Jpeg); |
290 | jpgData = stream.ToArray(); | 294 | jpgData = stream.ToArray(); |
291 | } | 295 | } |
292 | if (jpgData != Utils.EmptyBytes) | 296 | |
297 | if (jpgData == Utils.EmptyBytes) | ||
293 | { | 298 | { |
294 | string reason = string.Empty; | 299 | m_log.WarnFormat("{0} Tile image generation failed for region {1}", LogHeader, regionName); |
295 | if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, scene.RegionInfo.ScopeID, out reason)) | 300 | return false; |
296 | { | ||
297 | m_log.DebugFormat("{0} Unable to upload tile image for {1} at {2}-{3}: {4}", LogHeader, | ||
298 | regionName, locX, locY, reason); | ||
299 | } | ||
300 | } | 301 | } |
301 | else | 302 | |
303 | string reason = string.Empty; | ||
304 | if (!m_MapService.AddMapTile((int)locX, (int)locY, jpgData, scene.RegionInfo.ScopeID, out reason)) | ||
302 | { | 305 | { |
303 | m_log.WarnFormat("{0} Tile image generation failed for region {1}", LogHeader, regionName); | 306 | m_log.DebugFormat("{0} Unable to upload tile image for {1} at {2}-{3}: {4}", LogHeader, |
307 | regionName, locX, locY, reason); | ||
308 | return false; | ||
304 | } | 309 | } |
310 | return true; | ||
305 | } | 311 | } |
306 | } | 312 | } |
307 | } | 313 | } |
diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs index 84c4efe..762d2f7 100644 --- a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs +++ b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs | |||
@@ -229,6 +229,7 @@ namespace OpenSim.Services.Connectors | |||
229 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", | 229 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", |
230 | uri, | 230 | uri, |
231 | reqString, | 231 | reqString, |
232 | 30, | ||
232 | m_Auth); | 233 | m_Auth); |
233 | if (reply != string.Empty) | 234 | if (reply != string.Empty) |
234 | { | 235 | { |
@@ -271,7 +272,7 @@ namespace OpenSim.Services.Connectors | |||
271 | { | 272 | { |
272 | // This just dumps a warning for any operation that takes more than 100 ms | 273 | // This just dumps a warning for any operation that takes more than 100 ms |
273 | int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); | 274 | int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); |
274 | m_log.DebugFormat("[MAP IMAGE CONNECTOR]: map tile uploaded in {0}ms", tickdiff); | 275 | m_log.DebugFormat("[MAP IMAGE CONNECTOR]: map tile upload time {0}ms", tickdiff); |
275 | } | 276 | } |
276 | 277 | ||
277 | return false; | 278 | return false; |