diff options
author | John Hurliman | 2009-11-05 13:10:58 -0800 |
---|---|---|
committer | John Hurliman | 2009-11-05 13:10:58 -0800 |
commit | afef1ac191d32e9c1514c294b17e404b1d4ae217 (patch) | |
tree | c390ef81c9c30922c2e95e32844832919884fd9c /OpenSim/Region/CoreModules/World/Archiver | |
parent | Applying #4332, optional packet statistics logging (diff) | |
download | opensim-SC-afef1ac191d32e9c1514c294b17e404b1d4ae217.zip opensim-SC-afef1ac191d32e9c1514c294b17e404b1d4ae217.tar.gz opensim-SC-afef1ac191d32e9c1514c294b17e404b1d4ae217.tar.bz2 opensim-SC-afef1ac191d32e9c1514c294b17e404b1d4ae217.tar.xz |
Changing the AssetBase constructors to avoid initializing assets with an unknown asset type, and log an error if it ever does happen
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index c261943..70a225e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -332,10 +332,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
332 | { | 332 | { |
333 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; | 333 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; |
334 | 334 | ||
335 | if (assetType == (sbyte)AssetType.Unknown) | ||
336 | m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid); | ||
337 | |||
335 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); | 338 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); |
336 | 339 | ||
337 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); | 340 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType); |
338 | asset.Type = assetType; | ||
339 | asset.Data = data; | 341 | asset.Data = data; |
340 | 342 | ||
341 | // We're relying on the asset service to do the sensible thing and not store the asset if it already | 343 | // We're relying on the asset service to do the sensible thing and not store the asset if it already |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs index 5208e7a..2d2c570 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs | |||
@@ -158,9 +158,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
158 | 158 | ||
159 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); | 159 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); |
160 | 160 | ||
161 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); | 161 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType); |
162 | asset.Description = metadata.Description; | 162 | asset.Description = metadata.Description; |
163 | asset.Type = metadata.AssetType; | ||
164 | asset.Data = data; | 163 | asset.Data = data; |
165 | 164 | ||
166 | m_cache.Store(asset); | 165 | m_cache.Store(asset); |