diff options
author | Justin Clark-Casey (justincc) | 2011-04-18 22:24:42 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-04-18 22:24:42 +0100 |
commit | e00e518692bd3d123db69dceb98b80d3bdd59156 (patch) | |
tree | f44096fe815675a26d1ab878e18d0abddbafd5ed /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |
parent | refactor: split out the code which actually copies a particular bundle to inv... (diff) | |
download | opensim-SC_OLD-e00e518692bd3d123db69dceb98b80d3bdd59156.zip opensim-SC_OLD-e00e518692bd3d123db69dceb98b80d3bdd59156.tar.gz opensim-SC_OLD-e00e518692bd3d123db69dceb98b80d3bdd59156.tar.bz2 opensim-SC_OLD-e00e518692bd3d123db69dceb98b80d3bdd59156.tar.xz |
add test to ensure that an IAR starts with the control file
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index f3d2f26..9acdc90 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -77,12 +77,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
77 | /// </value> | 77 | /// </value> |
78 | private Stream m_loadStream; | 78 | private Stream m_loadStream; |
79 | 79 | ||
80 | /// <summary> | 80 | public bool ControlFileLoaded { get; private set; } |
81 | /// FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things | 81 | |
82 | /// (I thought they weren't). We will need to bump the version number and perform this check on all | ||
83 | /// subsequent IAR versions only | ||
84 | /// </summary> | ||
85 | protected bool m_controlFileLoaded = true; | ||
86 | protected bool m_assetsLoaded; | 82 | protected bool m_assetsLoaded; |
87 | protected bool m_inventoryNodesLoaded; | 83 | protected bool m_inventoryNodesLoaded; |
88 | 84 | ||
@@ -131,6 +127,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
131 | m_userInfo = userInfo; | 127 | m_userInfo = userInfo; |
132 | m_invPath = invPath; | 128 | m_invPath = invPath; |
133 | m_loadStream = loadStream; | 129 | m_loadStream = loadStream; |
130 | |||
131 | // FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things | ||
132 | // (I thought they weren't). We will need to bump the version number and perform this check on all | ||
133 | // subsequent IAR versions only | ||
134 | ControlFileLoaded = true; | ||
134 | } | 135 | } |
135 | 136 | ||
136 | /// <summary> | 137 | /// <summary> |
@@ -522,7 +523,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
522 | /// </summary> | 523 | /// </summary> |
523 | /// <param name="path"></param> | 524 | /// <param name="path"></param> |
524 | /// <param name="data"></param> | 525 | /// <param name="data"></param> |
525 | protected void LoadControlFile(string path, byte[] data) | 526 | public void LoadControlFile(string path, byte[] data) |
526 | { | 527 | { |
527 | XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data)); | 528 | XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data)); |
528 | XElement archiveElement = doc.Element("archive"); | 529 | XElement archiveElement = doc.Element("archive"); |
@@ -538,7 +539,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
538 | majorVersion, MAX_MAJOR_VERSION)); | 539 | majorVersion, MAX_MAJOR_VERSION)); |
539 | } | 540 | } |
540 | 541 | ||
541 | m_controlFileLoaded = true; | 542 | ControlFileLoaded = true; |
542 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version); | 543 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version); |
543 | } | 544 | } |
544 | 545 | ||
@@ -550,7 +551,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
550 | /// <param name="data"></param> | 551 | /// <param name="data"></param> |
551 | protected void LoadInventoryFile(string path, TarArchiveReader.TarEntryType entryType, byte[] data) | 552 | protected void LoadInventoryFile(string path, TarArchiveReader.TarEntryType entryType, byte[] data) |
552 | { | 553 | { |
553 | if (!m_controlFileLoaded) | 554 | if (!ControlFileLoaded) |
554 | throw new Exception( | 555 | throw new Exception( |
555 | string.Format( | 556 | string.Format( |
556 | "The IAR you are trying to load does not list {0} before {1}. Aborting load", | 557 | "The IAR you are trying to load does not list {0} before {1}. Aborting load", |
@@ -597,7 +598,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
597 | /// <param name="data"></param> | 598 | /// <param name="data"></param> |
598 | protected void LoadAssetFile(string path, byte[] data) | 599 | protected void LoadAssetFile(string path, byte[] data) |
599 | { | 600 | { |
600 | if (!m_controlFileLoaded) | 601 | if (!ControlFileLoaded) |
601 | throw new Exception( | 602 | throw new Exception( |
602 | string.Format( | 603 | string.Format( |
603 | "The IAR you are trying to load does not list {0} before {1}. Aborting load", | 604 | "The IAR you are trying to load does not list {0} before {1}. Aborting load", |