diff options
author | Dahlia Trimble | 2009-01-10 09:15:23 +0000 |
---|---|---|
committer | Dahlia Trimble | 2009-01-10 09:15:23 +0000 |
commit | 630ce5b26446883043aa5e6541a4550d0e918659 (patch) | |
tree | 5128485b0d8e94c96593b352a421623cbd053acb /OpenSim/Region/Environment/Modules/Agent/TextureDownload | |
parent | Include the changes from StrawBerryFride's patch to (diff) | |
download | opensim-SC_OLD-630ce5b26446883043aa5e6541a4550d0e918659.zip opensim-SC_OLD-630ce5b26446883043aa5e6541a4550d0e918659.tar.gz opensim-SC_OLD-630ce5b26446883043aa5e6541a4550d0e918659.tar.bz2 opensim-SC_OLD-630ce5b26446883043aa5e6541a4550d0e918659.tar.xz |
Revert progressive texture patch from r8001 until issues can be addressed
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Agent/TextureDownload')
3 files changed, 54 insertions, 60 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs index 2f5ea23..6bb61e2 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs | |||
@@ -204,14 +204,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
204 | /// <param name="e"></param> | 204 | /// <param name="e"></param> |
205 | public void TextureRequest(Object sender, TextureRequestArgs e) | 205 | public void TextureRequest(Object sender, TextureRequestArgs e) |
206 | { | 206 | { |
207 | IClientAPI client = (IClientAPI) sender; | 207 | IClientAPI client = (IClientAPI)sender; |
208 | 208 | ||
209 | if (e.Priority == 1016001f) // Preview | 209 | if (e.Priority == 1016001f) // Preview |
210 | { | 210 | { |
211 | if (client.Scene is Scene) | 211 | if (client.Scene is Scene) |
212 | { | 212 | { |
213 | Scene scene = (Scene)client.Scene; | 213 | Scene scene = (Scene)client.Scene; |
214 | 214 | ||
215 | CachedUserInfo profile = scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId); | 215 | CachedUserInfo profile = scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId); |
216 | if (profile == null) // Deny unknown user | 216 | if (profile == null) // Deny unknown user |
217 | return; | 217 | return; |
@@ -241,52 +241,44 @@ 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 | try | 248 | sender = m_queueSenders.Dequeue(); |
249 | |||
250 | if (sender.Cancel) | ||
249 | { | 251 | { |
250 | sender = m_queueSenders.Dequeue(); | 252 | TextureSent(sender); |
251 | 253 | ||
252 | if (sender.Cancel) | 254 | sender.Cancel = false; |
255 | } | ||
256 | else | ||
257 | { | ||
258 | bool finished = sender.SendTexturePacket(); | ||
259 | if (finished) | ||
253 | { | 260 | { |
254 | TextureSent(sender); | 261 | TextureSent(sender); |
255 | |||
256 | sender.Cancel = false; | ||
257 | } | 262 | } |
258 | else | 263 | else |
259 | { | 264 | { |
260 | bool finished = sender.SendTexturePacket(); | 265 | m_queueSenders.Enqueue(sender); |
261 | if (finished) | ||
262 | { | ||
263 | TextureSent(sender); | ||
264 | } | ||
265 | else | ||
266 | { | ||
267 | m_queueSenders.Enqueue(sender); | ||
268 | } | ||
269 | } | 266 | } |
267 | } | ||
270 | 268 | ||
271 | // Make sure that any sender we currently have can get garbage collected | 269 | // Make sure that any sender we currently have can get garbage collected |
272 | sender = null; | 270 | sender = null; |
273 | 271 | ||
274 | //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count()); | 272 | //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 | } | ||
281 | } | 273 | } |
282 | // } | 274 | } |
283 | // catch (Exception e) | 275 | catch (Exception e) |
284 | // { | 276 | { |
285 | // // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened | 277 | // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened |
286 | // m_log.ErrorFormat( | 278 | m_log.ErrorFormat( |
287 | // "[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}", | 279 | "[TEXTURE]: Texture send thread terminating with exception. PLEASE REBOOT YOUR SIM - TEXTURES WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}", |
288 | // e); | 280 | e); |
289 | // } | 281 | } |
290 | } | 282 | } |
291 | 283 | ||
292 | /// <summary> | 284 | /// <summary> |
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs index 044ee76..34ddee6 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using log4net; | 29 | using log4net; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using OpenMetaverse.Packets; | ||
31 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
32 | using OpenSim.Region.Environment.Interfaces; | 33 | using OpenSim.Region.Environment.Interfaces; |
33 | 34 | ||
@@ -38,11 +39,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
38 | /// </summary> | 39 | /// </summary> |
39 | public class TextureNotFoundSender : ITextureSender | 40 | public class TextureNotFoundSender : ITextureSender |
40 | { | 41 | { |
41 | // private static readonly log4net.ILog m_log | 42 | // private static readonly log4net.ILog m_log |
42 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 43 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
43 | 44 | ||
44 | // private IClientAPI m_client; | 45 | // private IClientAPI m_client; |
45 | // private UUID m_textureId; | 46 | // private UUID m_textureId; |
46 | 47 | ||
47 | public TextureNotFoundSender(IClientAPI client, UUID textureID) | 48 | public TextureNotFoundSender(IClientAPI client, UUID textureID) |
48 | { | 49 | { |
@@ -55,13 +56,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
55 | public bool Sending | 56 | public bool Sending |
56 | { | 57 | { |
57 | get { return false; } | 58 | get { return false; } |
58 | set {} | 59 | set { } |
59 | } | 60 | } |
60 | 61 | ||
61 | public bool Cancel | 62 | public bool Cancel |
62 | { | 63 | { |
63 | get { return false; } | 64 | get { return false; } |
64 | set {} | 65 | set { } |
65 | } | 66 | } |
66 | 67 | ||
67 | // See ITextureSender | 68 | // See ITextureSender |
@@ -73,13 +74,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
73 | // See ITextureSender | 74 | // See ITextureSender |
74 | public bool SendTexturePacket() | 75 | public bool SendTexturePacket() |
75 | { | 76 | { |
76 | // m_log.DebugFormat( | 77 | // m_log.DebugFormat( |
77 | // "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found", | 78 | // "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found", |
78 | // m_textureId); | 79 | // m_textureId); |
79 | 80 | ||
80 | // XXX Temporarily disabling as this appears to be causing client crashes on at least | 81 | // XXX Temporarily disabling as this appears to be causing client crashes on at least |
81 | // 1.19.0(5) of the Linden Second Life client. | 82 | // 1.19.0(5) of the Linden Second Life client. |
82 | // m_client.SendImageNotFound(m_textureId); | 83 | // m_client.SendImageNotFound(m_textureId); |
83 | 84 | ||
84 | return true; | 85 | return true; |
85 | } | 86 | } |
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index aab4ad0..e0790a2 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs | |||
@@ -56,10 +56,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
56 | /// <summary> | 56 | /// <summary> |
57 | /// We will allow the client to request the same texture n times before dropping further requests | 57 | /// We will allow the client to request the same texture n times before dropping further requests |
58 | /// | 58 | /// |
59 | /// This number contains repeated requests for the same texture at different resolutions (which | 59 | /// This number includes repeated requests for the same texture at different resolutions (which we don't |
60 | /// are handled since r7368). However, this situation should be handled in a more sophisticated way. | 60 | /// currently handle properly as far as I know). However, this situation should be handled in a more |
61 | /// sophisticated way. | ||
61 | /// </summary> | 62 | /// </summary> |
62 | private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 15; | 63 | private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 5; |
63 | 64 | ||
64 | /// <summary> | 65 | /// <summary> |
65 | /// XXX Also going to limit requests for found textures. | 66 | /// XXX Also going to limit requests for found textures. |
@@ -119,13 +120,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
119 | } | 120 | } |
120 | else | 121 | else |
121 | { | 122 | { |
122 | // m_log.DebugFormat("[TEXTURE]: Received a request for texture {0}", e.RequestedAssetID); | 123 | // m_log.DebugFormat("[TEXTURE]: Received a request for texture {0}", e.RequestedAssetID); |
123 | 124 | ||
124 | if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) | 125 | if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) |
125 | { | 126 | { |
126 | // m_log.DebugFormat( | 127 | // m_log.DebugFormat( |
127 | // "[TEXTURE]: Refusing request for {0} from client {1}", | 128 | // "[TEXTURE]: Refusing request for {0} from client {1}", |
128 | // e.RequestedAssetID, m_client.AgentId); | 129 | // e.RequestedAssetID, m_client.AgentId); |
129 | 130 | ||
130 | return; | 131 | return; |
131 | } | 132 | } |
@@ -138,9 +139,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
138 | 139 | ||
139 | // Commenting out this message for now as it causes too much noise with other | 140 | // Commenting out this message for now as it causes too much noise with other |
140 | // debug messages. | 141 | // debug messages. |
141 | // m_log.DebugFormat( | 142 | // m_log.DebugFormat( |
142 | // "[TEXTURE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests", | 143 | // "[TEXTURE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests", |
143 | // e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS); | 144 | // e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS); |
144 | } | 145 | } |
145 | 146 | ||
146 | return; | 147 | return; |
@@ -148,7 +149,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
148 | 149 | ||
149 | m_scene.AddPendingDownloads(1); | 150 | m_scene.AddPendingDownloads(1); |
150 | 151 | ||
151 | TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber, e.Priority); | 152 | TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber); |
152 | m_textureSenders.Add(e.RequestedAssetID, requestHandler); | 153 | m_textureSenders.Add(e.RequestedAssetID, requestHandler); |
153 | 154 | ||
154 | m_scene.AssetCache.GetAsset(e.RequestedAssetID, TextureCallback, true); | 155 | m_scene.AssetCache.GetAsset(e.RequestedAssetID, TextureCallback, true); |
@@ -195,9 +196,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
195 | { | 196 | { |
196 | missingTextureLimitStrategy.MonitorRequests(textureID); | 197 | missingTextureLimitStrategy.MonitorRequests(textureID); |
197 | 198 | ||
198 | // m_log.DebugFormat( | 199 | // m_log.DebugFormat( |
199 | // "[TEXTURE]: Queueing first TextureNotFoundSender for {0}, client {1}", | 200 | // "[TEXTURE]: Queueing first TextureNotFoundSender for {0}, client {1}", |
200 | // textureID, m_client.AgentId); | 201 | // textureID, m_client.AgentId); |
201 | } | 202 | } |
202 | 203 | ||
203 | ITextureSender textureNotFoundSender = new TextureNotFoundSender(m_client, textureID); | 204 | ITextureSender textureNotFoundSender = new TextureNotFoundSender(m_client, textureID); |