diff options
author | Justin Clark-Casey (justincc) | 2012-03-09 00:16:49 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-03-09 00:16:49 +0000 |
commit | 3c5bd7c35ab24250f4f65e4ba90b3febaf5edd06 (patch) | |
tree | 8772bd90d6233833116a0b8e55176019225bf79d /OpenSim/Data | |
parent | Put big fat EXPERIMENTAL warning in xassetservice database plugin (diff) | |
download | opensim-SC_OLD-3c5bd7c35ab24250f4f65e4ba90b3febaf5edd06.zip opensim-SC_OLD-3c5bd7c35ab24250f4f65e4ba90b3febaf5edd06.tar.gz opensim-SC_OLD-3c5bd7c35ab24250f4f65e4ba90b3febaf5edd06.tar.bz2 opensim-SC_OLD-3c5bd7c35ab24250f4f65e4ba90b3febaf5edd06.tar.xz |
minor: move some compression related var setup inside compression if/then switch
Diffstat (limited to 'OpenSim/Data')
-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 | } |