aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Scripting
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-09-06 00:11:47 +0100
committerJustin Clark-Casey (justincc)2012-09-06 00:11:47 +0100
commita0d0c9f751f45d54772af2e33866b27c9be33511 (patch)
treeb94a250c12264f8c44387e79e35b62893dab441b /OpenSim/Region/CoreModules/Scripting
parentBump master code up to 0.7.5 now that 0.7.4 is out. (diff)
downloadopensim-SC_OLD-a0d0c9f751f45d54772af2e33866b27c9be33511.zip
opensim-SC_OLD-a0d0c9f751f45d54772af2e33866b27c9be33511.tar.gz
opensim-SC_OLD-a0d0c9f751f45d54772af2e33866b27c9be33511.tar.bz2
opensim-SC_OLD-a0d0c9f751f45d54772af2e33866b27c9be33511.tar.xz
If the GetTexture capability receives a request for a range of data beyond that of an otherwise valid asset, return HTTP PartialContent rather than RequestedRangeNotSatisfiable.
This is because recent viewers (3.2.1, 3.3.4) and probably earlier ones using the http GetTexture capability will sometimes make such invalid range requests. This appears to happen if the viewer's estimate of texture sizes at discard levels > 0 (chiefly 2) exceeds the total texture size. I believe this does not normally happen but can occur for dynamic textures with are large but mainly blank. If this happens, returning a RequestedRangeNotSatisfiable will cause the viewer to not render the texture at the final resolution. However, returning a PartialContent (or OK) even with 0 data will allow the viewer to render the final texture.
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs16
-rw-r--r--OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs20
2 files changed, 33 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
index 3eedf49..e09f1a9 100644
--- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
42{ 42{
43 public class DynamicTextureModule : IRegionModule, IDynamicTextureManager 43 public class DynamicTextureModule : IRegionModule, IDynamicTextureManager
44 { 44 {
45 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 private const int ALL_SIDES = -1; 47 private const int ALL_SIDES = -1;
48 48
@@ -249,10 +249,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
249 } 249 }
250 } 250 }
251 251
252// m_log.DebugFormat(
253// "[DYNAMIC TEXTURE MODULE]: Requesting generation of new dynamic texture for {0} in {1}",
254// part.Name, part.ParentGroup.Scene.Name);
255
252 RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams); 256 RenderPlugins[contentType].AsyncConvertData(updater.UpdaterID, data, extraParams);
253 } 257 }
254 else 258 else
255 { 259 {
260// m_log.DebugFormat(
261// "[DYNAMIC TEXTURE MODULE]: Reusing cached texture {0} for {1} in {2}",
262// objReusableTextureUUID, part.Name, part.ParentGroup.Scene.Name);
263
256 // No need to add to updaters as the texture is always the same. Not that this functionality 264 // No need to add to updaters as the texture is always the same. Not that this functionality
257 // apppears to be implemented anyway. 265 // apppears to be implemented anyway.
258 updater.UpdatePart(part, (UUID)objReusableTextureUUID); 266 updater.UpdatePart(part, (UUID)objReusableTextureUUID);
@@ -448,8 +456,10 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
448 IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>(); 456 IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>();
449 if (cacheLayerDecode != null) 457 if (cacheLayerDecode != null)
450 { 458 {
451 cacheLayerDecode.Decode(asset.FullID, asset.Data); 459 if (!cacheLayerDecode.Decode(asset.FullID, asset.Data))
452 cacheLayerDecode = null; 460 m_log.WarnFormat(
461 "[DYNAMIC TEXTURE MODULE]: Decoding of dynamically generated asset {0} for {1} in {2} failed",
462 asset.ID, part.Name, part.ParentGroup.Scene.Name);
453 } 463 }
454 464
455 UUID oldID = UpdatePart(part, asset.FullID); 465 UUID oldID = UpdatePart(part, asset.FullID);
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
index 4268f2e..0e7051e 100644
--- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
@@ -46,6 +46,11 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
46{ 46{
47 public class VectorRenderModule : IRegionModule, IDynamicTextureRender 47 public class VectorRenderModule : IRegionModule, IDynamicTextureRender
48 { 48 {
49 // These fields exist for testing purposes, please do not remove.
50// private static bool s_flipper;
51// private static byte[] s_asset1Data;
52// private static byte[] s_asset2Data;
53
49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 55
51 private Scene m_scene; 56 private Scene m_scene;
@@ -161,6 +166,13 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
161 { 166 {
162 m_textureManager.RegisterRender(GetContentType(), this); 167 m_textureManager.RegisterRender(GetContentType(), this);
163 } 168 }
169
170 // This code exists for testing purposes, please do not remove.
171// s_asset1Data = m_scene.AssetService.Get("00000000-0000-1111-9999-000000000001").Data;
172// s_asset1Data = m_scene.AssetService.Get("9f4acf0d-1841-4e15-bdb8-3a12efc9dd8f").Data;
173
174 // Terrain dirt - smallest bin/assets file (6004 bytes)
175// s_asset2Data = m_scene.AssetService.Get("b8d3965a-ad78-bf43-699b-bff8eca6c975").Data;
164 } 176 }
165 177
166 public void Close() 178 public void Close()
@@ -364,6 +376,14 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
364 } 376 }
365 377
366 byte[] imageJ2000 = new byte[0]; 378 byte[] imageJ2000 = new byte[0];
379
380 // This code exists for testing purposes, please do not remove.
381// if (s_flipper)
382// imageJ2000 = s_asset1Data;
383// else
384// imageJ2000 = s_asset2Data;
385//
386// s_flipper = !s_flipper;
367 387
368 try 388 try
369 { 389 {