diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index f303498..903cb2d 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -65,6 +65,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
65 | /// uuids to request | 65 | /// uuids to request |
66 | /// </value> | 66 | /// </value> |
67 | protected IDictionary<UUID, sbyte> m_uuids; | 67 | protected IDictionary<UUID, sbyte> m_uuids; |
68 | private int m_previusErrorsCount; | ||
68 | 69 | ||
69 | /// <value> | 70 | /// <value> |
70 | /// Callback used when all the assets requested have been received. | 71 | /// Callback used when all the assets requested have been received. |
@@ -102,12 +103,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
102 | 103 | ||
103 | protected internal AssetsRequest( | 104 | protected internal AssetsRequest( |
104 | AssetsArchiver assetsArchiver, IDictionary<UUID, sbyte> uuids, | 105 | AssetsArchiver assetsArchiver, IDictionary<UUID, sbyte> uuids, |
106 | int previusErrorsCount, | ||
105 | IAssetService assetService, IUserAccountService userService, | 107 | IAssetService assetService, IUserAccountService userService, |
106 | UUID scope, Dictionary<string, object> options, | 108 | UUID scope, Dictionary<string, object> options, |
107 | AssetsRequestCallback assetsRequestCallback) | 109 | AssetsRequestCallback assetsRequestCallback) |
108 | { | 110 | { |
109 | m_assetsArchiver = assetsArchiver; | 111 | m_assetsArchiver = assetsArchiver; |
110 | m_uuids = uuids; | 112 | m_uuids = uuids; |
113 | m_previusErrorsCount = previusErrorsCount; | ||
111 | m_assetsRequestCallback = assetsRequestCallback; | 114 | m_assetsRequestCallback = assetsRequestCallback; |
112 | m_assetService = assetService; | 115 | m_assetService = assetService; |
113 | m_userAccountService = userService; | 116 | m_userAccountService = userService; |
@@ -119,8 +122,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
119 | protected internal void Execute() | 122 | protected internal void Execute() |
120 | { | 123 | { |
121 | Culture.SetCurrentCulture(); | 124 | Culture.SetCurrentCulture(); |
122 | m_log.DebugFormat("[ARCHIVER]: AssetsRequest executed looking for {0} possible assets", m_repliesRequired); | ||
123 | |||
124 | // We can stop here if there are no assets to fetch | 125 | // We can stop here if there are no assets to fetch |
125 | if (m_repliesRequired == 0) | 126 | if (m_repliesRequired == 0) |
126 | { | 127 | { |
@@ -169,19 +170,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
169 | } | 170 | } |
170 | 171 | ||
171 | m_timeOutTimer.Dispose(); | 172 | m_timeOutTimer.Dispose(); |
173 | int totalerrors = m_notFoundAssetUuids.Count + m_previusErrorsCount; | ||
172 | 174 | ||
173 | if(m_timeout) | 175 | if(m_timeout) |
174 | m_log.DebugFormat("[ARCHIVER]: Aborted because AssetService request timeout. Successfully added {0} assets", m_foundAssetUuids.Count); | 176 | m_log.DebugFormat("[ARCHIVER]: Aborted because AssetService request timeout. Successfully added {0} assets", m_foundAssetUuids.Count); |
175 | else if(m_notFoundAssetUuids.Count == 0) | 177 | else if(totalerrors == 0) |
176 | m_log.DebugFormat("[ARCHIVER]: Successfully added all {0} assets", m_foundAssetUuids.Count); | 178 | m_log.DebugFormat("[ARCHIVER]: Successfully added all {0} assets", m_foundAssetUuids.Count); |
177 | else | 179 | else |
178 | m_log.DebugFormat("[ARCHIVER]: Successfully added {0} assets ({1} assets not found)", | 180 | m_log.DebugFormat("[ARCHIVER]: Successfully added {0} assets ({1} assets of total request where not found or are damaged", |
179 | m_foundAssetUuids.Count, m_notFoundAssetUuids.Count); | 181 | m_foundAssetUuids.Count, totalerrors); |
180 | 182 | ||
181 | PerformAssetsRequestCallback(m_timeout); | 183 | PerformAssetsRequestCallback(m_timeout); |
182 | } | 184 | } |
183 | 185 | ||
184 | void OnTimeout(object source, ElapsedEventArgs args) | 186 | private void OnTimeout(object source, ElapsedEventArgs args) |
185 | { | 187 | { |
186 | m_timeout = true; | 188 | m_timeout = true; |
187 | } | 189 | } |
@@ -189,7 +191,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
189 | /// <summary> | 191 | /// <summary> |
190 | /// Perform the callback on the original requester of the assets | 192 | /// Perform the callback on the original requester of the assets |
191 | /// </summary> | 193 | /// </summary> |
192 | protected void PerformAssetsRequestCallback(object o) | 194 | private void PerformAssetsRequestCallback(object o) |
193 | { | 195 | { |
194 | if(m_assetsRequestCallback == null) | 196 | if(m_assetsRequestCallback == null) |
195 | return; | 197 | return; |
@@ -208,7 +210,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
208 | } | 210 | } |
209 | } | 211 | } |
210 | 212 | ||
211 | protected AssetBase PostProcess(AssetBase asset) | 213 | private AssetBase PostProcess(AssetBase asset) |
212 | { | 214 | { |
213 | if (asset.Type == (sbyte)AssetType.Object && asset.Data != null && m_options.ContainsKey("home")) | 215 | if (asset.Type == (sbyte)AssetType.Object && asset.Data != null && m_options.ContainsKey("home")) |
214 | { | 216 | { |