aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Agent
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Agent')
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs46
1 files changed, 28 insertions, 18 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
index aa4d070..af51df6 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
@@ -39,8 +39,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
39{ 39{
40 public class TextureDownloadModule : IRegionModule 40 public class TextureDownloadModule : IRegionModule
41 { 41 {
42 //private static readonly log4net.ILog m_log 42 private static readonly log4net.ILog m_log
43 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 43 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 /// <summary> 45 /// <summary>
46 /// There is one queue for all textures waiting to be sent, regardless of the requesting user. 46 /// There is one queue for all textures waiting to be sent, regardless of the requesting user.
@@ -176,34 +176,44 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
176 { 176 {
177 ITextureSender sender = null; 177 ITextureSender sender = null;
178 178
179 while (true) 179 try
180 { 180 {
181 sender = m_queueSenders.Dequeue(); 181 while (true)
182
183 if (sender.Cancel)
184 { 182 {
185 TextureSent(sender); 183 sender = m_queueSenders.Dequeue();
186 184
187 sender.Cancel = false; 185 if (sender.Cancel)
188 }
189 else
190 {
191 bool finished = sender.SendTexturePacket();
192 if (finished)
193 { 186 {
194 TextureSent(sender); 187 TextureSent(sender);
188
189 sender.Cancel = false;
195 } 190 }
196 else 191 else
197 { 192 {
198 m_queueSenders.Enqueue(sender); 193 bool finished = sender.SendTexturePacket();
194 if (finished)
195 {
196 TextureSent(sender);
197 }
198 else
199 {
200 m_queueSenders.Enqueue(sender);
201 }
199 } 202 }
200 }
201 203
202 // Make sure that any sender we currently have can get garbage collected 204 // Make sure that any sender we currently have can get garbage collected
203 sender = null; 205 sender = null;
204 206
205 //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count()); 207 //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count());
208 }
206 } 209 }
210 catch (Exception e)
211 {
212 // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened
213 m_log.ErrorFormat(
214 "[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}",
215 e);
216 }
207 } 217 }
208 218
209 /// <summary> 219 /// <summary>