aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-06-22 23:16:18 +0100
committerJustin Clark-Casey (justincc)2012-06-22 23:16:18 +0100
commitdca04c7b61abb7b7ea70299a192425ce3bd05937 (patch)
treec5af21989c732e8bd90b7c95a8ea1b3978c2e5b1 /OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
parentAvoid race condition between m_PrimObjects iteration in XEngine.PostObjectEve... (diff)
downloadopensim-SC-dca04c7b61abb7b7ea70299a192425ce3bd05937.zip
opensim-SC-dca04c7b61abb7b7ea70299a192425ce3bd05937.tar.gz
opensim-SC-dca04c7b61abb7b7ea70299a192425ce3bd05937.tar.bz2
opensim-SC-dca04c7b61abb7b7ea70299a192425ce3bd05937.tar.xz
Avoid a race condition where an incoming request to a script external URL can trigger an exception is the URL was being removed at the same time.
This involves three steps 1) Return gracefully in UrlModule.HttpRequestHandler() instead of throwing an exception when the url cannot be found in its index 2) Return true instead of false in HasEvents() if no matching request is found in the map. This call will only happen in the first place for raced requests. 3) Return a 404 in GetEvents() if the request is not in the index, rather than a blank 200 OK. Many thanks to Tom Haines in http://opensimulator.org/mantis/view.php?id=6051 for doing some of the work on this.
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
index 553a7eb..723530a 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
@@ -31,7 +31,6 @@ using OpenMetaverse;
31 31
32namespace OpenSim.Framework.Servers.HttpServer 32namespace OpenSim.Framework.Servers.HttpServer
33{ 33{
34
35 public class PollServiceHttpRequest 34 public class PollServiceHttpRequest
36 { 35 {
37 public readonly PollServiceEventArgs PollServiceArgs; 36 public readonly PollServiceEventArgs PollServiceArgs;
@@ -39,7 +38,9 @@ namespace OpenSim.Framework.Servers.HttpServer
39 public readonly IHttpRequest Request; 38 public readonly IHttpRequest Request;
40 public readonly int RequestTime; 39 public readonly int RequestTime;
41 public readonly UUID RequestID; 40 public readonly UUID RequestID;
42 public PollServiceHttpRequest(PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest) 41
42 public PollServiceHttpRequest(
43 PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest)
43 { 44 {
44 PollServiceArgs = pPollServiceArgs; 45 PollServiceArgs = pPollServiceArgs;
45 HttpContext = pHttpContext; 46 HttpContext = pHttpContext;
@@ -48,4 +49,4 @@ namespace OpenSim.Framework.Servers.HttpServer
48 RequestID = UUID.Random(); 49 RequestID = UUID.Random();
49 } 50 }
50 } 51 }
51} 52} \ No newline at end of file