aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs58
1 files changed, 33 insertions, 25 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
index 35fa5ed..2f5ea23 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
@@ -241,44 +241,52 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
241 { 241 {
242 ITextureSender sender = null; 242 ITextureSender sender = null;
243 243
244 try 244// try
245 { 245// {
246 while (true) 246 while (true)
247 { 247 {
248 sender = m_queueSenders.Dequeue(); 248 try
249
250 if (sender.Cancel)
251 { 249 {
252 TextureSent(sender); 250 sender = m_queueSenders.Dequeue();
253 251
254 sender.Cancel = false; 252 if (sender.Cancel)
255 }
256 else
257 {
258 bool finished = sender.SendTexturePacket();
259 if (finished)
260 { 253 {
261 TextureSent(sender); 254 TextureSent(sender);
255
256 sender.Cancel = false;
262 } 257 }
263 else 258 else
264 { 259 {
265 m_queueSenders.Enqueue(sender); 260 bool finished = sender.SendTexturePacket();
261 if (finished)
262 {
263 TextureSent(sender);
264 }
265 else
266 {
267 m_queueSenders.Enqueue(sender);
268 }
266 } 269 }
267 }
268 270
269 // Make sure that any sender we currently have can get garbage collected 271 // Make sure that any sender we currently have can get garbage collected
270 sender = null; 272 sender = null;
271 273
272 //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count()); 274 //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count());
275 }
276 catch(Exception e)
277 {
278 m_log.ErrorFormat(
279 "[TEXTURE]: Texture send thread caught exception. The texture send was aborted. Exception is {0}", e);
280 }
273 } 281 }
274 } 282// }
275 catch (Exception e) 283// catch (Exception e)
276 { 284// {
277 // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened 285// // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened
278 m_log.ErrorFormat( 286// m_log.ErrorFormat(
279 "[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}", 287// "[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}",
280 e); 288// e);
281 } 289// }
282 } 290 }
283 291
284 /// <summary> 292 /// <summary>