aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/TextureDownloadModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/TextureDownloadModule.cs22
1 files changed, 13 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs
index c773f9e..2b2ac42 100644
--- a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs
@@ -52,7 +52,8 @@ namespace OpenSim.Region.Environment.Modules
52 /// <summary> 52 /// <summary>
53 /// There is one queue for all textures waiting to be sent, regardless of the requesting user. 53 /// There is one queue for all textures waiting to be sent, regardless of the requesting user.
54 /// </summary> 54 /// </summary>
55 private readonly BlockingQueue<TextureSender> m_queueSenders = new BlockingQueue<TextureSender>(); 55 private readonly BlockingQueue<ITextureSender> m_queueSenders
56 = new BlockingQueue<ITextureSender>();
56 57
57 /// <summary> 58 /// <summary>
58 /// Each user has their own texture download service. 59 /// Each user has their own texture download service.
@@ -135,17 +136,19 @@ namespace OpenSim.Region.Environment.Modules
135 /// <param name="userID"></param> 136 /// <param name="userID"></param>
136 /// <param name="textureService"></param> 137 /// <param name="textureService"></param>
137 /// <returns>Always returns true, since a service is created if one does not already exist</returns> 138 /// <returns>Always returns true, since a service is created if one does not already exist</returns>
138 private bool TryGetUserTextureService(LLUUID userID, out UserTextureDownloadService textureService) 139 private bool TryGetUserTextureService(
140 IClientAPI client, out UserTextureDownloadService textureService)
139 { 141 {
140 lock (m_userTextureServices) 142 lock (m_userTextureServices)
141 { 143 {
142 if (m_userTextureServices.TryGetValue(userID, out textureService)) 144 if (m_userTextureServices.TryGetValue(client.AgentId, out textureService))
143 { 145 {
144 return true; 146 return true;
145 } 147 }
146 148
147 textureService = new UserTextureDownloadService(m_scene, m_queueSenders); 149 textureService = new UserTextureDownloadService(client, m_scene, m_queueSenders);
148 m_userTextureServices.Add(userID, textureService); 150 m_userTextureServices.Add(client.AgentId, textureService);
151
149 return true; 152 return true;
150 } 153 }
151 } 154 }
@@ -159,9 +162,10 @@ namespace OpenSim.Region.Environment.Modules
159 { 162 {
160 IClientAPI client = (IClientAPI) sender; 163 IClientAPI client = (IClientAPI) sender;
161 UserTextureDownloadService textureService; 164 UserTextureDownloadService textureService;
162 if (TryGetUserTextureService(client.AgentId, out textureService)) 165
166 if (TryGetUserTextureService(client, out textureService))
163 { 167 {
164 textureService.HandleTextureRequest(client, e); 168 textureService.HandleTextureRequest(e);
165 } 169 }
166 } 170 }
167 171
@@ -170,7 +174,7 @@ namespace OpenSim.Region.Environment.Modules
170 /// </summary> 174 /// </summary>
171 public void ProcessTextureSenders() 175 public void ProcessTextureSenders()
172 { 176 {
173 TextureSender sender = null; 177 ITextureSender sender = null;
174 178
175 while (true) 179 while (true)
176 { 180 {
@@ -206,7 +210,7 @@ namespace OpenSim.Region.Environment.Modules
206 /// Called when the texture has finished sending. 210 /// Called when the texture has finished sending.
207 /// </summary> 211 /// </summary>
208 /// <param name="sender"></param> 212 /// <param name="sender"></param>
209 private void TextureSent(TextureSender sender) 213 private void TextureSent(ITextureSender sender)
210 { 214 {
211 sender.Sending = false; 215 sender.Sending = false;
212 //m_log.DebugFormat("[TEXTURE DOWNLOAD]: Removing download stat for {0}", sender.assetID); 216 //m_log.DebugFormat("[TEXTURE DOWNLOAD]: Removing download stat for {0}", sender.assetID);