diff options
Diffstat (limited to 'OpenSim/Framework/Servers')
-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 a1bc27b..7c7d08d 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
52 | 52 | ||
53 | public enum EventType : int | 53 | public enum EventType : int |
54 | { | 54 | { |
55 | LongPoll = 0, | 55 | Poll = 0, |
56 | LslHttp = 1, | 56 | LslHttp = 1, |
57 | Inventory = 2, | 57 | Inventory = 2, |
58 | Texture = 3, | 58 | Texture = 3, |
@@ -85,7 +85,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
85 | Drop = pDrop; | 85 | Drop = pDrop; |
86 | Id = pId; | 86 | Id = pId; |
87 | TimeOutms = pTimeOutms; | 87 | TimeOutms = pTimeOutms; |
88 | Type = EventType.LongPoll; | 88 | Type = EventType.Poll; |
89 | } | 89 | } |
90 | } | 90 | } |
91 | } | 91 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 82c7727..4dad44a 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() |
@@ -176,17 +172,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
176 | public void EnqueueInt(PollServiceHttpRequest req) | 172 | public void EnqueueInt(PollServiceHttpRequest req) |
177 | { | 173 | { |
178 | if (m_running) | 174 | if (m_running) |
179 | { | 175 | m_requests.Enqueue(req); |
180 | if (req.PollServiceArgs.Type != PollServiceEventArgs.EventType.LongPoll) | ||
181 | { | ||
182 | m_requests.Enqueue(req); | ||
183 | } | ||
184 | else | ||
185 | { | ||
186 | lock (m_slowRequests) | ||
187 | m_slowRequests.Enqueue(req); | ||
188 | } | ||
189 | } | ||
190 | } | 176 | } |
191 | 177 | ||
192 | private void CheckRetries() | 178 | private void CheckRetries() |
@@ -201,17 +187,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
201 | while (m_retryRequests.Count > 0 && m_running) | 187 | while (m_retryRequests.Count > 0 && m_running) |
202 | m_requests.Enqueue(m_retryRequests.Dequeue()); | 188 | m_requests.Enqueue(m_retryRequests.Dequeue()); |
203 | } | 189 | } |
204 | slowCount++; | ||
205 | if (slowCount >= 10) | ||
206 | { | ||
207 | slowCount = 0; | ||
208 | |||
209 | lock (m_slowRequests) | ||
210 | { | ||
211 | while (m_slowRequests.Count > 0 && m_running) | ||
212 | m_requests.Enqueue(m_slowRequests.Dequeue()); | ||
213 | } | ||
214 | } | ||
215 | } | 190 | } |
216 | } | 191 | } |
217 | 192 | ||
@@ -244,13 +219,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
244 | PollServiceHttpRequest wreq; | 219 | PollServiceHttpRequest wreq; |
245 | m_retryRequests.Clear(); | 220 | m_retryRequests.Clear(); |
246 | 221 | ||
247 | lock (m_slowRequests) | ||
248 | { | ||
249 | while (m_slowRequests.Count > 0) | ||
250 | m_requests.Enqueue(m_slowRequests.Dequeue()); | ||
251 | |||
252 | } | ||
253 | |||
254 | while (m_requests.Count() > 0) | 222 | while (m_requests.Count() > 0) |
255 | { | 223 | { |
256 | try | 224 | try |