diff options
author | Melanie | 2009-09-21 18:11:40 +0100 |
---|---|---|
committer | Melanie | 2009-09-21 18:11:40 +0100 |
commit | bc9e4cfd961e6ed0184165e4f3cbb770b47a8dff (patch) | |
tree | 3c66054deffbafcc10354880d33676e03f9341a9 /OpenSim/Framework/Servers/HttpServer | |
parent | Add a UUID param to NoEvents in PollServiceEventArgs to make it more generic (diff) | |
download | opensim-SC-bc9e4cfd961e6ed0184165e4f3cbb770b47a8dff.zip opensim-SC-bc9e4cfd961e6ed0184165e4f3cbb770b47a8dff.tar.gz opensim-SC-bc9e4cfd961e6ed0184165e4f3cbb770b47a8dff.tar.bz2 opensim-SC-bc9e4cfd961e6ed0184165e4f3cbb770b47a8dff.tar.xz |
Add a RequestID (UUID.Random()) to the PollRequest and pass it to all
even hander delegates.
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer')
4 files changed, 10 insertions, 7 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index ed387d1..61cb8aa 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs | |||
@@ -30,11 +30,11 @@ using System.Collections; | |||
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | namespace OpenSim.Framework.Servers.HttpServer | 31 | namespace OpenSim.Framework.Servers.HttpServer |
32 | { | 32 | { |
33 | public delegate bool HasEventsMethod(UUID pId); | 33 | public delegate bool HasEventsMethod(UUID requestID, UUID pId); |
34 | 34 | ||
35 | public delegate Hashtable GetEventsMethod(UUID pId, string request); | 35 | public delegate Hashtable GetEventsMethod(UUID requestID, UUID pId, string request); |
36 | 36 | ||
37 | public delegate Hashtable NoEventsMethod(UUID pId); | 37 | public delegate Hashtable NoEventsMethod(UUID requestID, UUID pId); |
38 | 38 | ||
39 | public class PollServiceEventArgs : EventArgs | 39 | public class PollServiceEventArgs : EventArgs |
40 | { | 40 | { |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs index ff7c1e8..553a7eb 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using HttpServer; | 29 | using HttpServer; |
30 | using OpenMetaverse; | ||
30 | 31 | ||
31 | namespace OpenSim.Framework.Servers.HttpServer | 32 | namespace OpenSim.Framework.Servers.HttpServer |
32 | { | 33 | { |
@@ -37,12 +38,14 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
37 | public readonly IHttpClientContext HttpContext; | 38 | public readonly IHttpClientContext HttpContext; |
38 | public readonly IHttpRequest Request; | 39 | public readonly IHttpRequest Request; |
39 | public readonly int RequestTime; | 40 | public readonly int RequestTime; |
41 | public readonly UUID RequestID; | ||
40 | public PollServiceHttpRequest(PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest) | 42 | public PollServiceHttpRequest(PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest) |
41 | { | 43 | { |
42 | PollServiceArgs = pPollServiceArgs; | 44 | PollServiceArgs = pPollServiceArgs; |
43 | HttpContext = pHttpContext; | 45 | HttpContext = pHttpContext; |
44 | Request = pRequest; | 46 | Request = pRequest; |
45 | RequestTime = System.Environment.TickCount; | 47 | RequestTime = System.Environment.TickCount; |
48 | RequestID = UUID.Random(); | ||
46 | } | 49 | } |
47 | } | 50 | } |
48 | } | 51 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index db80f1d..1c54581 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -130,7 +130,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
130 | foreach (object o in m_requests) | 130 | foreach (object o in m_requests) |
131 | { | 131 | { |
132 | PollServiceHttpRequest req = (PollServiceHttpRequest) o; | 132 | PollServiceHttpRequest req = (PollServiceHttpRequest) o; |
133 | m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.PollServiceArgs.Id), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); | 133 | m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); |
134 | } | 134 | } |
135 | 135 | ||
136 | m_requests.Clear(); | 136 | m_requests.Clear(); |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs index 1e8706c..ce32443 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs | |||
@@ -100,11 +100,11 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
100 | PollServiceHttpRequest req = m_request.Dequeue(); | 100 | PollServiceHttpRequest req = m_request.Dequeue(); |
101 | try | 101 | try |
102 | { | 102 | { |
103 | if (req.PollServiceArgs.HasEvents(req.PollServiceArgs.Id)) | 103 | if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) |
104 | { | 104 | { |
105 | StreamReader str = new StreamReader(req.Request.Body); | 105 | StreamReader str = new StreamReader(req.Request.Body); |
106 | 106 | ||
107 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.PollServiceArgs.Id, str.ReadToEnd()); | 107 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); |
108 | m_server.DoHTTPGruntWork(responsedata, | 108 | m_server.DoHTTPGruntWork(responsedata, |
109 | new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); | 109 | new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); |
110 | } | 110 | } |
@@ -112,7 +112,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
112 | { | 112 | { |
113 | if ((Environment.TickCount - req.RequestTime) > m_timeout) | 113 | if ((Environment.TickCount - req.RequestTime) > m_timeout) |
114 | { | 114 | { |
115 | m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.PollServiceArgs.Id), | 115 | m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id), |
116 | new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); | 116 | new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); |
117 | } | 117 | } |
118 | else | 118 | else |