diff options
After seeing sdague do his happy dance over trunk working "the best he has ever seen". I'm not sure I should be doing this commit, but oh well.
So anyway, it moves the Asset downloading (packet sending) to a module (AssetDownloadModule).
So now at last, AssetCache should be just dealing with fetching assets from the asset server and caching them.
Diffstat (limited to 'OpenSim/Framework/Communications/Cache')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 061b857..abb7ce1 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -69,12 +69,12 @@ namespace OpenSim.Framework.Communications.Cache | |||
69 | /// | 69 | /// |
70 | /// Assets requests which are waiting for asset server data. This includes texture requests | 70 | /// Assets requests which are waiting for asset server data. This includes texture requests |
71 | /// </summary> | 71 | /// </summary> |
72 | private Dictionary<LLUUID, AssetRequest> RequestedAssets; | 72 | // private Dictionary<LLUUID, AssetRequest> RequestedAssets; |
73 | 73 | ||
74 | /// <summary> | 74 | /// <summary> |
75 | /// Asset requests with data which are ready to be sent back to requesters. This includes textures. | 75 | /// Asset requests with data which are ready to be sent back to requesters. This includes textures. |
76 | /// </summary> | 76 | /// </summary> |
77 | private List<AssetRequest> AssetRequests; | 77 | // private List<AssetRequest> AssetRequests; |
78 | 78 | ||
79 | 79 | ||
80 | /// <summary> | 80 | /// <summary> |
@@ -84,7 +84,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
84 | 84 | ||
85 | private readonly IAssetServer m_assetServer; | 85 | private readonly IAssetServer m_assetServer; |
86 | 86 | ||
87 | private readonly Thread m_assetCacheThread; | 87 | // private readonly Thread m_assetCacheThread; |
88 | 88 | ||
89 | /// <summary> | 89 | /// <summary> |
90 | /// Report statistical data. | 90 | /// Report statistical data. |
@@ -94,8 +94,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
94 | m_log.InfoFormat("Assets:{0} Textures:{1} AssetRequests:{2} RequestedAssets:{3} RequestLists:{4}", | 94 | m_log.InfoFormat("Assets:{0} Textures:{1} AssetRequests:{2} RequestedAssets:{3} RequestLists:{4}", |
95 | Assets.Count, | 95 | Assets.Count, |
96 | Textures.Count, | 96 | Textures.Count, |
97 | AssetRequests.Count, | 97 | // AssetRequests.Count, |
98 | RequestedAssets.Count, | 98 | // RequestedAssets.Count, |
99 | RequestLists.Count); | 99 | RequestLists.Count); |
100 | 100 | ||
101 | int temporaryImages = 0; | 101 | int temporaryImages = 0; |
@@ -150,9 +150,9 @@ namespace OpenSim.Framework.Communications.Cache | |||
150 | { | 150 | { |
151 | Assets = new Dictionary<LLUUID, AssetInfo>(); | 151 | Assets = new Dictionary<LLUUID, AssetInfo>(); |
152 | Textures = new Dictionary<LLUUID, TextureImage>(); | 152 | Textures = new Dictionary<LLUUID, TextureImage>(); |
153 | AssetRequests = new List<AssetRequest>(); | 153 | // AssetRequests = new List<AssetRequest>(); |
154 | 154 | ||
155 | RequestedAssets = new Dictionary<LLUUID, AssetRequest>(); | 155 | // RequestedAssets = new Dictionary<LLUUID, AssetRequest>(); |
156 | RequestLists = new Dictionary<LLUUID, AssetRequestsList>(); | 156 | RequestLists = new Dictionary<LLUUID, AssetRequestsList>(); |
157 | } | 157 | } |
158 | 158 | ||
@@ -168,18 +168,18 @@ namespace OpenSim.Framework.Communications.Cache | |||
168 | m_assetServer = assetServer; | 168 | m_assetServer = assetServer; |
169 | m_assetServer.SetReceiver(this); | 169 | m_assetServer.SetReceiver(this); |
170 | 170 | ||
171 | m_assetCacheThread = new Thread(new ThreadStart(RunAssetManager)); | 171 | // m_assetCacheThread = new Thread(new ThreadStart(RunAssetManager)); |
172 | m_assetCacheThread.Name = "AssetCacheThread"; | 172 | // m_assetCacheThread.Name = "AssetCacheThread"; |
173 | m_assetCacheThread.IsBackground = true; | 173 | // m_assetCacheThread.IsBackground = true; |
174 | m_assetCacheThread.Start(); | 174 | // m_assetCacheThread.Start(); |
175 | OpenSim.Framework.ThreadTracker.Add(m_assetCacheThread); | 175 | // OpenSim.Framework.ThreadTracker.Add(m_assetCacheThread); |
176 | } | 176 | } |
177 | 177 | ||
178 | /// <summary> | 178 | /// <summary> |
179 | /// Process the asset queue which holds data which is packeted up and sent | 179 | /// Process the asset queue which holds data which is packeted up and sent |
180 | /// directly back to the client. | 180 | /// directly back to the client. |
181 | /// </summary> | 181 | /// </summary> |
182 | public void RunAssetManager() | 182 | /* public void RunAssetManager() |
183 | { | 183 | { |
184 | while (true) | 184 | while (true) |
185 | { | 185 | { |
@@ -193,7 +193,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
193 | m_log.Error("[ASSET CACHE]: " + e.ToString()); | 193 | m_log.Error("[ASSET CACHE]: " + e.ToString()); |
194 | } | 194 | } |
195 | } | 195 | } |
196 | } | 196 | }*/ |
197 | 197 | ||
198 | /// <summary> | 198 | /// <summary> |
199 | /// Only get an asset if we already have it in the cache. | 199 | /// Only get an asset if we already have it in the cache. |
@@ -449,7 +449,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
449 | StatsManager.SimExtraStats.AddAsset(assetInf); | 449 | StatsManager.SimExtraStats.AddAsset(assetInf); |
450 | } | 450 | } |
451 | 451 | ||
452 | if (RequestedAssets.ContainsKey(assetInf.FullID)) | 452 | /* if (RequestedAssets.ContainsKey(assetInf.FullID)) |
453 | { | 453 | { |
454 | #if DEBUG | 454 | #if DEBUG |
455 | //m_log.DebugFormat("[ASSET CACHE]: Moving {0} from RequestedAssets to AssetRequests", asset.FullID); | 455 | //m_log.DebugFormat("[ASSET CACHE]: Moving {0} from RequestedAssets to AssetRequests", asset.FullID); |
@@ -461,7 +461,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
461 | 461 | ||
462 | RequestedAssets.Remove(assetInf.FullID); | 462 | RequestedAssets.Remove(assetInf.FullID); |
463 | AssetRequests.Add(req); | 463 | AssetRequests.Add(req); |
464 | } | 464 | }*/ |
465 | } | 465 | } |
466 | } | 466 | } |
467 | 467 | ||
@@ -541,6 +541,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
541 | 541 | ||
542 | } | 542 | } |
543 | 543 | ||
544 | /* | ||
544 | /// <summary> | 545 | /// <summary> |
545 | /// Calculate the number of packets required to send the asset to the client. | 546 | /// Calculate the number of packets required to send the asset to the client. |
546 | /// </summary> | 547 | /// </summary> |
@@ -734,7 +735,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
734 | { | 735 | { |
735 | } | 736 | } |
736 | } | 737 | } |
737 | 738 | */ | |
738 | 739 | ||
739 | public class AssetInfo : AssetBase | 740 | public class AssetInfo : AssetBase |
740 | { | 741 | { |