aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2012-09-26 03:05:27 +0100
committerUbitUmarov2012-09-26 03:05:27 +0100
commit654dd289f263a4eef4f2aa70a1cb8d289ec7e04c (patch)
treec38144c74469b7536d11c5002d3ba931bdb9ded1
parent fix priorityQueue to correctly use the fairness counts starting at 8 for (diff)
downloadopensim-SC_OLD-654dd289f263a4eef4f2aa70a1cb8d289ec7e04c.zip
opensim-SC_OLD-654dd289f263a4eef4f2aa70a1cb8d289ec7e04c.tar.gz
opensim-SC_OLD-654dd289f263a4eef4f2aa70a1cb8d289ec7e04c.tar.bz2
opensim-SC_OLD-654dd289f263a4eef4f2aa70a1cb8d289ec7e04c.tar.xz
more changes to PollService
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs1
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs41
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs7
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs1
4 files changed, 25 insertions, 25 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
index a80b1d7..9b27a6e 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
@@ -47,6 +47,7 @@ namespace OpenSim.Framework.Servers.HttpServer
47 public UUID Id; 47 public UUID Id;
48 public int TimeOutms; 48 public int TimeOutms;
49 public EventType Type; 49 public EventType Type;
50 public bool GetEventsNeedsRequest = true;
50 51
51 public enum EventType : int 52 public enum EventType : int
52 { 53 {
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index c13c65b..c234537 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -205,7 +205,7 @@ namespace OpenSim.Framework.Servers.HttpServer
205 String.Format("PollServiceWorkerThread{0}", i), 205 String.Format("PollServiceWorkerThread{0}", i),
206 ThreadPriority.Normal, 206 ThreadPriority.Normal,
207 false, 207 false,
208 true, 208 false,
209 null, 209 null,
210 int.MaxValue); 210 int.MaxValue);
211 } 211 }
@@ -344,35 +344,36 @@ namespace OpenSim.Framework.Servers.HttpServer
344 { 344 {
345 if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) 345 if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
346 { 346 {
347 try 347 string strreq = "";
348 if (req.PollServiceArgs.GetEventsNeedsRequest)
348 { 349 {
349 str = new StreamReader(req.Request.Body); 350 try
351 {
352 str = new StreamReader(req.Request.Body);
353 strreq = str.ReadToEnd();
354 str.Close();
355 }
356 catch
357 {
358 continue;
359 }
350 } 360 }
351 catch (System.ArgumentException) 361
352 { 362 Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, strreq);
353 // Stream was not readable means a child agent 363
354 // was closed due to logout, leaving the 364 if (responsedata == null)
355 // Event Queue request orphaned.
356 continue; 365 continue;
357 }
358 366
359 // "Normal" means the viewer evebt queue. We need to push these out fast.
360 // Process them inline. The rest go to the thread pool.
361 if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Normal) 367 if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Normal)
362 { 368 {
363 try 369 try
364 { 370 {
365 Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
366 DoHTTPGruntWork(m_server, req, responsedata); 371 DoHTTPGruntWork(m_server, req, responsedata);
367 } 372 }
368 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream 373 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
369 { 374 {
370 // Ignore it, no need to reply 375 // Ignore it, no need to reply
371 } 376 }
372 finally
373 {
374 str.Close();
375 }
376 } 377 }
377 else 378 else
378 { 379 {
@@ -380,27 +381,19 @@ namespace OpenSim.Framework.Servers.HttpServer
380 { 381 {
381 try 382 try
382 { 383 {
383 Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
384 DoHTTPGruntWork(m_server, req, responsedata); 384 DoHTTPGruntWork(m_server, req, responsedata);
385 } 385 }
386 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream 386 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
387 { 387 {
388 // Ignore it, no need to reply 388 // Ignore it, no need to reply
389 } 389 }
390 finally
391 {
392 str.Close();
393 }
394 390
395 return null; 391 return null;
396 }, null); 392 }, null);
397 } 393 }
398
399 } 394 }
400 else 395 else
401 { 396 {
402// if ((Environment.TickCount - req.RequestTime) > m_timeout)
403
404 if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) 397 if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
405 { 398 {
406 DoHTTPGruntWork(m_server, req, 399 DoHTTPGruntWork(m_server, req,
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
index b16076d..8a607fb 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
@@ -160,7 +160,11 @@ namespace OpenSim.Region.ClientStack.Linden
160 { 160 {
161 m_scene = scene; 161 m_scene = scene;
162 162
163 HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; 163 HasEvents = (x, y) =>
164 {
165 lock (responses)
166 return responses.ContainsKey(x);
167 };
164 GetEvents = (x, y, s) => 168 GetEvents = (x, y, s) =>
165 { 169 {
166 lock (responses) 170 lock (responses)
@@ -247,6 +251,7 @@ namespace OpenSim.Region.ClientStack.Linden
247 PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); 251 PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene);
248 252
249 args.Type = PollServiceEventArgs.EventType.Texture; 253 args.Type = PollServiceEventArgs.EventType.Texture;
254 args.GetEventsNeedsRequest = false;
250 MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); 255 MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args);
251 256
252 string hostName = m_scene.RegionInfo.ExternalHostName; 257 string hostName = m_scene.RegionInfo.ExternalHostName;
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index 0f305b1..56070c6 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -223,6 +223,7 @@ namespace OpenSim.Region.ClientStack.Linden
223 PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(agentID); 223 PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(agentID);
224 224
225 args.Type = PollServiceEventArgs.EventType.Inventory; 225 args.Type = PollServiceEventArgs.EventType.Inventory;
226 args.GetEventsNeedsRequest = false;
226 MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); 227 MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args);
227 228
228 string hostName = m_scene.RegionInfo.ExternalHostName; 229 string hostName = m_scene.RegionInfo.ExternalHostName;