diff options
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs | 74 |
2 files changed, 39 insertions, 48 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs index 0d95f15..fa5369f 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs | |||
@@ -60,8 +60,6 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload | |||
60 | private Scene m_scene; | 60 | private Scene m_scene; |
61 | private List<Scene> m_scenes = new List<Scene>(); | 61 | private List<Scene> m_scenes = new List<Scene>(); |
62 | 62 | ||
63 | private Thread m_thread; | ||
64 | |||
65 | public TextureDownloadModule() | 63 | public TextureDownloadModule() |
66 | { | 64 | { |
67 | } | 65 | } |
@@ -70,15 +68,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload | |||
70 | 68 | ||
71 | public void Initialise(Scene scene, IConfigSource config) | 69 | public void Initialise(Scene scene, IConfigSource config) |
72 | { | 70 | { |
71 | |||
73 | if (m_scene == null) | 72 | if (m_scene == null) |
74 | { | 73 | { |
75 | //m_log.Debug("Creating Texture download module"); | 74 | //m_log.Debug("Creating Texture download module"); |
76 | m_scene = scene; | 75 | m_scene = scene; |
77 | m_thread = new Thread(new ThreadStart(ProcessTextureSenders)); | 76 | //m_thread = new Thread(new ThreadStart(ProcessTextureSenders)); |
78 | m_thread.Name = "ProcessTextureSenderThread"; | 77 | //m_thread.Name = "ProcessTextureSenderThread"; |
79 | m_thread.IsBackground = true; | 78 | //m_thread.IsBackground = true; |
80 | m_thread.Start(); | 79 | //m_thread.Start(); |
81 | ThreadTracker.Add(m_thread); | 80 | //ThreadTracker.Add(m_thread); |
82 | } | 81 | } |
83 | 82 | ||
84 | if (!m_scenes.Contains(scene)) | 83 | if (!m_scenes.Contains(scene)) |
diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs index b333f73..5be2a65 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs | |||
@@ -106,67 +106,57 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload | |||
106 | /// <param name="e"></param> | 106 | /// <param name="e"></param> |
107 | public void HandleTextureRequest(TextureRequestArgs e) | 107 | public void HandleTextureRequest(TextureRequestArgs e) |
108 | { | 108 | { |
109 | TextureSender.TextureSender textureSender; | 109 | |
110 | //TextureSender.TextureSender textureSender; | ||
110 | 111 | ||
111 | //TODO: should be working out the data size/ number of packets to be sent for each discard level | 112 | //TODO: should be working out the data size/ number of packets to be sent for each discard level |
112 | if ((e.DiscardLevel >= 0) || (e.Priority != 0)) | 113 | //if ((e.DiscardLevel >= 0) || (e.Priority != 0)) |
113 | { | 114 | //{ |
114 | lock (m_textureSenders) | 115 | //lock (m_textureSenders) |
115 | { | 116 | //{ |
116 | if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) | 117 | //if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) |
117 | { | 118 | //{ |
118 | // If we've received new non UUID information for this request and it hasn't dispatched | 119 | // If we've received new non UUID information for this request and it hasn't dispatched |
119 | // yet, then update the request accordingly. | 120 | // yet, then update the request accordingly. |
120 | textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber); | 121 | // textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber); |
121 | } | 122 | //} |
122 | else | 123 | //else |
123 | { | 124 | //{ |
124 | // m_log.DebugFormat("[TEXTURE]: Received a request for texture {0}", e.RequestedAssetID); | 125 | // m_log.DebugFormat("[TEXTURE]: Received a request for texture {0}", e.RequestedAssetID); |
125 | 126 | ||
126 | if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) | 127 | //if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) |
127 | { | 128 | //{ |
128 | // m_log.DebugFormat( | 129 | // m_log.DebugFormat( |
129 | // "[TEXTURE]: Refusing request for {0} from client {1}", | 130 | // "[TEXTURE]: Refusing request for {0} from client {1}", |
130 | // e.RequestedAssetID, m_client.AgentId); | 131 | // e.RequestedAssetID, m_client.AgentId); |
131 | 132 | ||
132 | return; | 133 | //return; |
133 | } | 134 | //} |
134 | else if (!missingTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) | 135 | //else if (!missingTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) |
135 | { | 136 | //{ |
136 | if (missingTextureLimitStrategy.IsFirstRefusal(e.RequestedAssetID)) | 137 | // if (missingTextureLimitStrategy.IsFirstRefusal(e.RequestedAssetID)) |
137 | { | 138 | // { |
138 | if (StatsManager.SimExtraStats != null) | 139 | // if (StatsManager.SimExtraStats != null) |
139 | StatsManager.SimExtraStats.AddBlockedMissingTextureRequest(); | 140 | // StatsManager.SimExtraStats.AddBlockedMissingTextureRequest(); |
140 | 141 | ||
141 | // Commenting out this message for now as it causes too much noise with other | 142 | // Commenting out this message for now as it causes too much noise with other |
142 | // debug messages. | 143 | // debug messages. |
143 | // m_log.DebugFormat( | 144 | // m_log.DebugFormat( |
144 | // "[TEXTURE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests", | 145 | // "[TEXTURE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests", |
145 | // e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS); | 146 | // e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS); |
146 | } | 147 | // } |
147 | 148 | ||
148 | return; | 149 | // return; |
149 | } | 150 | //} |
150 | 151 | ||
151 | m_scene.StatsReporter.AddPendingDownloads(1); | 152 | m_scene.StatsReporter.AddPendingDownloads(1); |
152 | 153 | ||
153 | TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber); | 154 | //TextureSender.TextureSender requestHandler = new TextureSender.TextureSender(m_client, e.DiscardLevel, e.PacketNumber); |
154 | m_textureSenders.Add(e.RequestedAssetID, requestHandler); | 155 | //m_textureSenders.Add(e.RequestedAssetID, null); |
155 | 156 | ||
156 | m_scene.AssetService.Get(e.RequestedAssetID.ToString(), this, TextureReceived); | 157 | m_scene.AssetService.Get(e.RequestedAssetID.ToString(), this, TextureReceived); |
157 | } | 158 | |
158 | } | 159 | |
159 | } | ||
160 | else | ||
161 | { | ||
162 | lock (m_textureSenders) | ||
163 | { | ||
164 | if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) | ||
165 | { | ||
166 | textureSender.Cancel = true; | ||
167 | } | ||
168 | } | ||
169 | } | ||
170 | } | 160 | } |
171 | 161 | ||
172 | protected void TextureReceived(string id, Object sender, AssetBase asset) | 162 | protected void TextureReceived(string id, Object sender, AssetBase asset) |
@@ -189,6 +179,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload | |||
189 | if (closed) | 179 | if (closed) |
190 | return; | 180 | return; |
191 | 181 | ||
182 | /* | ||
192 | lock (m_textureSenders) | 183 | lock (m_textureSenders) |
193 | { | 184 | { |
194 | TextureSender.TextureSender textureSender; | 185 | TextureSender.TextureSender textureSender; |
@@ -233,6 +224,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload | |||
233 | textureID); | 224 | textureID); |
234 | } | 225 | } |
235 | } | 226 | } |
227 | */ | ||
236 | } | 228 | } |
237 | 229 | ||
238 | /// <summary> | 230 | /// <summary> |