diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 7 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs | 13 |
2 files changed, 15 insertions, 5 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 3252251..5bc85ff 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -41,6 +41,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
41 | 41 | ||
42 | private readonly BaseHttpServer m_server; | 42 | private readonly BaseHttpServer m_server; |
43 | private static Queue m_requests = Queue.Synchronized(new Queue()); | 43 | private static Queue m_requests = Queue.Synchronized(new Queue()); |
44 | private static ManualResetEvent m_ev = new ManualResetEvent(false); | ||
44 | private uint m_WorkerThreadCount = 0; | 45 | private uint m_WorkerThreadCount = 0; |
45 | private Thread[] m_workerThreads; | 46 | private Thread[] m_workerThreads; |
46 | private PollServiceWorkerThread[] m_PollServiceWorkerThreads; | 47 | private PollServiceWorkerThread[] m_PollServiceWorkerThreads; |
@@ -90,15 +91,17 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
90 | { | 91 | { |
91 | lock (m_requests) | 92 | lock (m_requests) |
92 | m_requests.Enqueue(req); | 93 | m_requests.Enqueue(req); |
94 | m_ev.Set(); | ||
93 | } | 95 | } |
94 | 96 | ||
95 | public void ThreadStart() | 97 | public void ThreadStart() |
96 | { | 98 | { |
97 | while (m_running) | 99 | while (m_running) |
98 | { | 100 | { |
101 | m_ev.WaitOne(1000); | ||
102 | m_ev.Reset(); | ||
99 | Watchdog.UpdateThread(); | 103 | Watchdog.UpdateThread(); |
100 | ProcessQueuedRequests(); | 104 | ProcessQueuedRequests(); |
101 | Thread.Sleep(1000); | ||
102 | } | 105 | } |
103 | } | 106 | } |
104 | 107 | ||
@@ -154,4 +157,4 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
154 | m_running = false; | 157 | m_running = false; |
155 | } | 158 | } |
156 | } | 159 | } |
157 | } \ No newline at end of file | 160 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs index 35a8dee..d305782 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs | |||
@@ -89,8 +89,15 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
89 | continue; | 89 | continue; |
90 | } | 90 | } |
91 | 91 | ||
92 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); | 92 | try |
93 | DoHTTPGruntWork(m_server, req, responsedata); | 93 | { |
94 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); | ||
95 | DoHTTPGruntWork(m_server, req, responsedata); | ||
96 | } | ||
97 | catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream | ||
98 | { | ||
99 | // Ignore it, no need to reply | ||
100 | } | ||
94 | } | 101 | } |
95 | else | 102 | else |
96 | { | 103 | { |
@@ -161,4 +168,4 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
161 | } | 168 | } |
162 | } | 169 | } |
163 | } | 170 | } |
164 | } \ No newline at end of file | 171 | } |