diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLXAssetData.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs index 501cf1a..95ef72a 100644 --- a/OpenSim/Data/MySQL/MySQLXAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs | |||
@@ -214,17 +214,16 @@ namespace OpenSim.Data.MySQL | |||
214 | m_log.Warn("[XASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add"); | 214 | m_log.Warn("[XASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add"); |
215 | } | 215 | } |
216 | 216 | ||
217 | byte[] compressedData; | ||
218 | MemoryStream outputStream = new MemoryStream(); | ||
219 | |||
220 | if (m_enableCompression) | 217 | if (m_enableCompression) |
221 | { | 218 | { |
219 | MemoryStream outputStream = new MemoryStream(); | ||
220 | |||
222 | using (GZipStream compressionStream = new GZipStream(outputStream, CompressionMode.Compress, false)) | 221 | using (GZipStream compressionStream = new GZipStream(outputStream, CompressionMode.Compress, false)) |
223 | { | 222 | { |
224 | // Console.WriteLine(WebUtil.CopyTo(new MemoryStream(asset.Data), compressionStream, int.MaxValue)); | 223 | // Console.WriteLine(WebUtil.CopyTo(new MemoryStream(asset.Data), compressionStream, int.MaxValue)); |
225 | // We have to close the compression stream in order to make sure it writes everything out to the underlying memory output stream. | 224 | // We have to close the compression stream in order to make sure it writes everything out to the underlying memory output stream. |
226 | compressionStream.Close(); | 225 | compressionStream.Close(); |
227 | compressedData = outputStream.ToArray(); | 226 | byte[] compressedData = outputStream.ToArray(); |
228 | asset.Data = compressedData; | 227 | asset.Data = compressedData; |
229 | } | 228 | } |
230 | } | 229 | } |