diff options
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 34 |
2 files changed, 3 insertions, 35 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index 8ace7a9..7150aad 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
50 | 50 | ||
51 | public enum EventType : int | 51 | public enum EventType : int |
52 | { | 52 | { |
53 | LongPoll = 0, | 53 | Poll = 0, |
54 | LslHttp = 1, | 54 | LslHttp = 1, |
55 | Inventory = 2, | 55 | Inventory = 2, |
56 | Texture = 3, | 56 | Texture = 3, |
@@ -82,7 +82,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
82 | NoEvents = pNoEvents; | 82 | NoEvents = pNoEvents; |
83 | Id = pId; | 83 | Id = pId; |
84 | TimeOutms = pTimeOutms; | 84 | TimeOutms = pTimeOutms; |
85 | Type = EventType.LongPoll; | 85 | Type = EventType.Poll; |
86 | } | 86 | } |
87 | } | 87 | } |
88 | } | 88 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 936146d..314719c 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -48,7 +48,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
48 | 48 | ||
49 | private Dictionary<PollServiceHttpRequest, Queue<PollServiceHttpRequest>> m_bycontext; | 49 | private Dictionary<PollServiceHttpRequest, Queue<PollServiceHttpRequest>> m_bycontext; |
50 | private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>(); | 50 | private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>(); |
51 | private static Queue<PollServiceHttpRequest> m_slowRequests = new Queue<PollServiceHttpRequest>(); | ||
52 | private static Queue<PollServiceHttpRequest> m_retryRequests = new Queue<PollServiceHttpRequest>(); | 51 | private static Queue<PollServiceHttpRequest> m_retryRequests = new Queue<PollServiceHttpRequest>(); |
53 | 52 | ||
54 | private uint m_WorkerThreadCount = 0; | 53 | private uint m_WorkerThreadCount = 0; |
@@ -56,11 +55,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
56 | private Thread m_retrysThread; | 55 | private Thread m_retrysThread; |
57 | 56 | ||
58 | private bool m_running = false; | 57 | private bool m_running = false; |
59 | private int slowCount = 0; | ||
60 | 58 | ||
61 | private SmartThreadPool m_threadPool; | 59 | private SmartThreadPool m_threadPool; |
62 | 60 | ||
63 | |||
64 | public PollServiceRequestManager( | 61 | public PollServiceRequestManager( |
65 | BaseHttpServer pSrv, bool performResponsesAsync, uint pWorkerThreadCount, int pTimeout) | 62 | BaseHttpServer pSrv, bool performResponsesAsync, uint pWorkerThreadCount, int pTimeout) |
66 | { | 63 | { |
@@ -80,7 +77,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
80 | startInfo.ThreadPoolName = "PoolService"; | 77 | startInfo.ThreadPoolName = "PoolService"; |
81 | 78 | ||
82 | m_threadPool = new SmartThreadPool(startInfo); | 79 | m_threadPool = new SmartThreadPool(startInfo); |
83 | |||
84 | } | 80 | } |
85 | 81 | ||
86 | public void Start() | 82 | public void Start() |
@@ -163,17 +159,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
163 | public void EnqueueInt(PollServiceHttpRequest req) | 159 | public void EnqueueInt(PollServiceHttpRequest req) |
164 | { | 160 | { |
165 | if (m_running) | 161 | if (m_running) |
166 | { | 162 | m_requests.Enqueue(req); |
167 | if (req.PollServiceArgs.Type != PollServiceEventArgs.EventType.LongPoll) | ||
168 | { | ||
169 | m_requests.Enqueue(req); | ||
170 | } | ||
171 | else | ||
172 | { | ||
173 | lock (m_slowRequests) | ||
174 | m_slowRequests.Enqueue(req); | ||
175 | } | ||
176 | } | ||
177 | } | 163 | } |
178 | 164 | ||
179 | private void CheckRetries() | 165 | private void CheckRetries() |
@@ -188,17 +174,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
188 | while (m_retryRequests.Count > 0 && m_running) | 174 | while (m_retryRequests.Count > 0 && m_running) |
189 | m_requests.Enqueue(m_retryRequests.Dequeue()); | 175 | m_requests.Enqueue(m_retryRequests.Dequeue()); |
190 | } | 176 | } |
191 | slowCount++; | ||
192 | if (slowCount >= 10) | ||
193 | { | ||
194 | slowCount = 0; | ||
195 | |||
196 | lock (m_slowRequests) | ||
197 | { | ||
198 | while (m_slowRequests.Count > 0 && m_running) | ||
199 | m_requests.Enqueue(m_slowRequests.Dequeue()); | ||
200 | } | ||
201 | } | ||
202 | } | 177 | } |
203 | } | 178 | } |
204 | 179 | ||
@@ -231,13 +206,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
231 | PollServiceHttpRequest wreq; | 206 | PollServiceHttpRequest wreq; |
232 | m_retryRequests.Clear(); | 207 | m_retryRequests.Clear(); |
233 | 208 | ||
234 | lock (m_slowRequests) | ||
235 | { | ||
236 | while (m_slowRequests.Count > 0) | ||
237 | m_requests.Enqueue(m_slowRequests.Dequeue()); | ||
238 | |||
239 | } | ||
240 | |||
241 | while (m_requests.Count() > 0) | 209 | while (m_requests.Count() > 0) |
242 | { | 210 | { |
243 | try | 211 | try |