diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Agent/TextureDownload')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index 42624ad..10ef766 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs | |||
@@ -46,6 +46,12 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
46 | { | 46 | { |
47 | private static readonly ILog m_log | 47 | private static readonly ILog m_log |
48 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | |||
50 | /// <summary> | ||
51 | /// True if the service has been closed, probably because a user with texture requests still queued | ||
52 | /// logged out. | ||
53 | /// </summary> | ||
54 | private bool closed; | ||
49 | 55 | ||
50 | /// <summary> | 56 | /// <summary> |
51 | /// 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 |
@@ -169,11 +175,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
169 | public void TextureCallback(LLUUID textureID, AssetBase texture) | 175 | public void TextureCallback(LLUUID textureID, AssetBase texture) |
170 | { | 176 | { |
171 | //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); | 177 | //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); |
178 | |||
179 | // There may still be texture requests pending for a logged out client | ||
180 | if (closed) | ||
181 | return; | ||
172 | 182 | ||
173 | lock (m_textureSenders) | 183 | lock (m_textureSenders) |
174 | { | 184 | { |
175 | TextureSender.TextureSender textureSender; | 185 | TextureSender.TextureSender textureSender; |
176 | |||
177 | if (m_textureSenders.TryGetValue(textureID, out textureSender)) | 186 | if (m_textureSenders.TryGetValue(textureID, out textureSender)) |
178 | { | 187 | { |
179 | // XXX It may be perfectly valid for a texture to have no data... but if we pass | 188 | // XXX It may be perfectly valid for a texture to have no data... but if we pass |
@@ -211,7 +220,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
211 | else | 220 | else |
212 | { | 221 | { |
213 | m_log.WarnFormat( | 222 | m_log.WarnFormat( |
214 | "Got a texture uuid {0} with no sender object to handle it, this shouldn't happen", | 223 | "[USER TEXTURE DOWNLOAD SERVICE]: Got a texture uuid {0} with no sender object to handle it, this shouldn't happen", |
215 | textureID); | 224 | textureID); |
216 | } | 225 | } |
217 | } | 226 | } |
@@ -237,6 +246,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
237 | /// </summary> | 246 | /// </summary> |
238 | internal void Close() | 247 | internal void Close() |
239 | { | 248 | { |
249 | closed = true; | ||
250 | |||
240 | lock (m_textureSenders) | 251 | lock (m_textureSenders) |
241 | { | 252 | { |
242 | foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) | 253 | foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) |
@@ -246,6 +257,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload | |||
246 | 257 | ||
247 | m_textureSenders.Clear(); | 258 | m_textureSenders.Clear(); |
248 | } | 259 | } |
260 | |||
261 | // XXX: It might be possible to also remove pending texture requests from the asset cache queues, | ||
262 | // though this might also be more trouble than it's worth. | ||
249 | } | 263 | } |
250 | } | 264 | } |
251 | } | 265 | } |