aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Services/FSAssetService/FSAssetService.cs29
-rw-r--r--prebuild.xml1
2 files changed, 29 insertions, 1 deletions
diff --git a/OpenSim/Services/FSAssetService/FSAssetService.cs b/OpenSim/Services/FSAssetService/FSAssetService.cs
index 04f6d79..c2e379b 100644
--- a/OpenSim/Services/FSAssetService/FSAssetService.cs
+++ b/OpenSim/Services/FSAssetService/FSAssetService.cs
@@ -35,6 +35,7 @@ using System.Threading;
35using System.Reflection; 35using System.Reflection;
36using OpenSim.Data; 36using OpenSim.Data;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Serialization.External;
38using OpenSim.Framework.Console; 39using OpenSim.Framework.Console;
39using OpenSim.Server.Base; 40using OpenSim.Server.Base;
40using OpenSim.Services.Base; 41using OpenSim.Services.Base;
@@ -394,9 +395,18 @@ namespace OpenSim.Services.FSAssetService
394 } 395 }
395 if (asset == null) 396 if (asset == null)
396 m_missingAssetsFS++; 397 m_missingAssetsFS++;
397 // m_log.InfoFormat("[FSASSETS]: Asset {0}, hash {1} not found in FS", id, hash); 398 // m_log.InfoFormat("[FSASSETS]: Asset {0}, hash {1} not found in FS", id, hash);
398 else 399 else
400 {
401 // Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8)
402 // Fix bad assets before sending them elsewhere
403 if (asset.Type == (int)AssetType.Object && asset.Data != null)
404 {
405 string xml = ExternalRepresentationUtils.SanitizeXml(Utils.BytesToString(asset.Data));
406 asset.Data = Utils.StringToBytes(xml);
407 }
399 return asset; 408 return asset;
409 }
400 } 410 }
401 411
402 lock (m_statsLock) 412 lock (m_statsLock)
@@ -404,6 +414,15 @@ namespace OpenSim.Services.FSAssetService
404 m_readTicks += Environment.TickCount - startTime; 414 m_readTicks += Environment.TickCount - startTime;
405 m_readCount++; 415 m_readCount++;
406 } 416 }
417
418 // Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8)
419 // Fix bad assets before sending them elsewhere
420 if (newAsset.Type == (int)AssetType.Object && newAsset.Data != null)
421 {
422 string xml = ExternalRepresentationUtils.SanitizeXml(Utils.BytesToString(newAsset.Data));
423 newAsset.Data = Utils.StringToBytes(xml);
424 }
425
407 return newAsset; 426 return newAsset;
408 } 427 }
409 catch (Exception exception) 428 catch (Exception exception)
@@ -519,6 +538,14 @@ namespace OpenSim.Services.FSAssetService
519 538
520 if (!File.Exists(finalFile)) 539 if (!File.Exists(finalFile))
521 { 540 {
541 // Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8)
542 // Fix bad assets before storing on this server
543 if (asset.Type == (int)AssetType.Object && asset.Data != null)
544 {
545 string xml = ExternalRepresentationUtils.SanitizeXml(Utils.BytesToString(asset.Data));
546 asset.Data = Utils.StringToBytes(xml);
547 }
548
522 FileStream fs = File.Create(tempFile); 549 FileStream fs = File.Create(tempFile);
523 550
524 fs.Write(asset.Data, 0, asset.Data.Length); 551 fs.Write(asset.Data, 0, asset.Data.Length);
diff --git a/prebuild.xml b/prebuild.xml
index f44008c..ed1c7fe 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -926,6 +926,7 @@
926 <Reference name="OpenMetaverse" path="../../../bin/"/> 926 <Reference name="OpenMetaverse" path="../../../bin/"/>
927 <Reference name="OpenSim.Framework"/> 927 <Reference name="OpenSim.Framework"/>
928 <Reference name="OpenSim.Framework.Console"/> 928 <Reference name="OpenSim.Framework.Console"/>
929 <Reference name="OpenSim.Framework.Serialization"/>
929 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 930 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
930 <Reference name="OpenSim.Server.Base"/> 931 <Reference name="OpenSim.Server.Base"/>
931 <Reference name="OpenSim.Services.Interfaces"/> 932 <Reference name="OpenSim.Services.Interfaces"/>