From af5ea18f33a8e259e2a2912c505ad5189d131fc7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 11 Oct 2015 23:04:22 +0100 Subject: [PATCH] use System.IO.Compression.DeflateStream for mesh decompression like master, since ACE zlib does seem to fail to decompress some meshs present at OSG, (possible same issue happens with map with option to draw prims) --- .../PhysicsModules/ubOdeMeshing/Meshmerizer.cs | 18 +++++++++--------- prebuild.xml | 1 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs index 7b13f6a704..84df369cf2 100644 --- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs @@ -43,7 +43,6 @@ using log4net; using Nini.Config; using System.Reflection; using System.IO; -using ComponentAce.Compression.Libs.zlib; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; @@ -449,22 +448,23 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing { using (MemoryStream outMs = new MemoryStream()) { - using (ZOutputStream zOut = new ZOutputStream(outMs)) + using (DeflateStream decompressionStream = new DeflateStream(inMs, CompressionMode.Decompress)) { byte[] readBuffer = new byte[2048]; + inMs.Read(readBuffer, 0, 2); // skip first 2 bytes in header int readLen = 0; - while ((readLen = inMs.Read(readBuffer, 0, readBuffer.Length)) > 0) - { - zOut.Write(readBuffer, 0, readLen); - } - zOut.Flush(); + + while ((readLen = decompressionStream.Read(readBuffer, 0, readBuffer.Length)) > 0) + outMs.Write(readBuffer, 0, readLen); + + outMs.Flush(); outMs.Seek(0, SeekOrigin.Begin); byte[] decompressedBuf = outMs.GetBuffer(); - decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf); + decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf); } - } + } } } catch (Exception e) diff --git a/prebuild.xml b/prebuild.xml index 7bafd78f4a..4415a5c76a 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1725,7 +1725,6 @@ -