diff options
* ARequest changed name to AssetRequest and moved to own file.
* The AssetServerBase is now responsible for dequeueing, the server implementations merely recieves ProcessRequest( AssetRequest req )
* Catchall added around queue processing thread so thread won't abort on exceptions.
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/SQLAssetServer.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/SQLAssetServer.cs | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs index 9d08785..010581f 100644 --- a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs +++ b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
57 | if (typeInterface != null) | 57 | if (typeInterface != null) |
58 | { | 58 | { |
59 | IAssetProvider plug = | 59 | IAssetProvider plug = |
60 | (IAssetProvider) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 60 | (IAssetProvider)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
61 | m_assetProviderPlugin = plug; | 61 | m_assetProviderPlugin = plug; |
62 | m_assetProviderPlugin.Initialise(); | 62 | m_assetProviderPlugin.Initialise(); |
63 | 63 | ||
@@ -65,12 +65,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
65 | "Added " + m_assetProviderPlugin.Name + " " + | 65 | "Added " + m_assetProviderPlugin.Name + " " + |
66 | m_assetProviderPlugin.Version); | 66 | m_assetProviderPlugin.Version); |
67 | } | 67 | } |
68 | |||
69 | typeInterface = null; | ||
70 | } | 68 | } |
71 | } | 69 | } |
72 | |||
73 | pluginAssembly = null; | ||
74 | } | 70 | } |
75 | 71 | ||
76 | 72 | ||
@@ -81,27 +77,20 @@ namespace OpenSim.Framework.Communications.Cache | |||
81 | m_assetProviderPlugin.CommitAssets(); | 77 | m_assetProviderPlugin.CommitAssets(); |
82 | } | 78 | } |
83 | 79 | ||
84 | protected override void RunRequests() | 80 | protected override void ProcessRequest(AssetRequest req) |
85 | { | 81 | { |
86 | while (true) | 82 | AssetBase asset; |
83 | lock (syncLock) | ||
87 | { | 84 | { |
88 | ARequest req = _assetRequests.Dequeue(); | 85 | asset = m_assetProviderPlugin.FetchAsset(req.AssetID); |
89 | 86 | } | |
90 | //MainLog.Instance.Verbose("AssetStorage","Requesting asset: " + req.AssetID); | 87 | if (asset != null) |
91 | 88 | { | |
92 | AssetBase asset = null; | 89 | _receiver.AssetReceived(asset, req.IsTexture); |
93 | lock (syncLock) | 90 | } |
94 | { | 91 | else |
95 | asset = m_assetProviderPlugin.FetchAsset(req.AssetID); | 92 | { |
96 | } | 93 | _receiver.AssetNotFound(req.AssetID); |
97 | if (asset != null) | ||
98 | { | ||
99 | _receiver.AssetReceived(asset, req.IsTexture); | ||
100 | } | ||
101 | else | ||
102 | { | ||
103 | _receiver.AssetNotFound(req.AssetID); | ||
104 | } | ||
105 | } | 94 | } |
106 | } | 95 | } |
107 | 96 | ||