aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs31
1 files changed, 24 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs
index e3de13b..f38f354 100644
--- a/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs
@@ -184,13 +184,15 @@ namespace OpenSim.Region.Environment.Modules
184 184
185 public void StopHttpRequest(uint m_localID, LLUUID m_itemID) 185 public void StopHttpRequest(uint m_localID, LLUUID m_itemID)
186 { 186 {
187 lock (HttpListLock) 187 if(m_pendingRequests != null) {
188 { 188 lock (HttpListLock)
189 HttpRequestClass tmpReq;
190 if (m_pendingRequests.TryGetValue(m_itemID, out tmpReq))
191 { 189 {
192 tmpReq.Stop(); 190 HttpRequestClass tmpReq;
193 m_pendingRequests.Remove(m_itemID); 191 if (m_pendingRequests.TryGetValue(m_itemID, out tmpReq))
192 {
193 tmpReq.Stop();
194 m_pendingRequests.Remove(m_itemID);
195 }
194 } 196 }
195 } 197 }
196 } 198 }
@@ -216,7 +218,6 @@ namespace OpenSim.Region.Environment.Modules
216 { 218 {
217 if (tmpReq.finished) 219 if (tmpReq.finished)
218 { 220 {
219 m_pendingRequests.Remove(luid);
220 return tmpReq; 221 return tmpReq;
221 } 222 }
222 } 223 }
@@ -224,6 +225,21 @@ namespace OpenSim.Region.Environment.Modules
224 } 225 }
225 return null; 226 return null;
226 } 227 }
228
229 public void RemoveCompletedRequest(LLUUID id)
230 {
231 lock (HttpListLock)
232 {
233 HttpRequestClass tmpReq;
234 if (m_pendingRequests.TryGetValue(id, out tmpReq))
235 {
236 tmpReq.Stop();
237 tmpReq = null;
238 m_pendingRequests.Remove(id);
239 }
240 }
241 }
242
227 } 243 }
228 244
229 // 245 //
@@ -269,6 +285,7 @@ namespace OpenSim.Region.Environment.Modules
269 httpThread.Name = "HttpRequestThread"; 285 httpThread.Name = "HttpRequestThread";
270 httpThread.Priority = ThreadPriority.BelowNormal; 286 httpThread.Priority = ThreadPriority.BelowNormal;
271 httpThread.IsBackground = true; 287 httpThread.IsBackground = true;
288 finished = false;
272 httpThread.Start(); 289 httpThread.Start();
273 } 290 }
274 291