aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/AssetBase.cs3
-rw-r--r--OpenSim/Framework/Console/RemoteConsole.cs2
-rw-r--r--OpenSim/Framework/IClientAPI.cs1
-rw-r--r--OpenSim/Framework/PriorityQueue.cs20
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs5
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs4
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs67
7 files changed, 52 insertions, 50 deletions
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs
index ff240be..5da8e11 100644
--- a/OpenSim/Framework/AssetBase.cs
+++ b/OpenSim/Framework/AssetBase.cs
@@ -150,7 +150,8 @@ namespace OpenSim.Framework
150 Type == (sbyte)AssetType.SnapshotFolder || 150 Type == (sbyte)AssetType.SnapshotFolder ||
151 Type == (sbyte)AssetType.TrashFolder || 151 Type == (sbyte)AssetType.TrashFolder ||
152 Type == (sbyte)AssetType.ImageJPEG || 152 Type == (sbyte)AssetType.ImageJPEG ||
153 Type == (sbyte) AssetType.ImageTGA || 153 Type == (sbyte)AssetType.ImageTGA ||
154 Type == (sbyte)AssetType.Mesh ||
154 Type == (sbyte) AssetType.LSLBytecode); 155 Type == (sbyte) AssetType.LSLBytecode);
155 } 156 }
156 } 157 }
diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs
index 50eb173..3e3c2b3 100644
--- a/OpenSim/Framework/Console/RemoteConsole.cs
+++ b/OpenSim/Framework/Console/RemoteConsole.cs
@@ -425,7 +425,7 @@ namespace OpenSim.Framework.Console
425 return false; 425 return false;
426 } 426 }
427 427
428 private Hashtable GetEvents(UUID RequestID, UUID sessionID, string request) 428 private Hashtable GetEvents(UUID RequestID, UUID sessionID)
429 { 429 {
430 ConsoleConnection c = null; 430 ConsoleConnection c = null;
431 431
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 91f36a5..4ae533e 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1171,6 +1171,7 @@ namespace OpenSim.Framework
1171 /// </summary> 1171 /// </summary>
1172 /// <param name="Item"></param> 1172 /// <param name="Item"></param>
1173 void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId); 1173 void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId);
1174 void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId);
1174 1175
1175 void SendRemoveInventoryItem(UUID itemID); 1176 void SendRemoveInventoryItem(UUID itemID);
1176 1177
diff --git a/OpenSim/Framework/PriorityQueue.cs b/OpenSim/Framework/PriorityQueue.cs
index e7a7f7f..e4f1111 100644
--- a/OpenSim/Framework/PriorityQueue.cs
+++ b/OpenSim/Framework/PriorityQueue.cs
@@ -45,7 +45,8 @@ namespace OpenSim.Framework
45 /// <summary> 45 /// <summary>
46 /// Total number of queues (priorities) available 46 /// Total number of queues (priorities) available
47 /// </summary> 47 /// </summary>
48 public const uint NumberOfQueues = 12; 48
49 public const uint NumberOfQueues = 12; // includes immediate queues, m_queueCounts need to be set acording
49 50
50 /// <summary> 51 /// <summary>
51 /// Number of queuest (priorities) that are processed immediately 52 /// Number of queuest (priorities) that are processed immediately
@@ -60,7 +61,8 @@ namespace OpenSim.Framework
60 // each pass. weighted towards the higher priority queues 61 // each pass. weighted towards the higher priority queues
61 private uint m_nextQueue = 0; 62 private uint m_nextQueue = 0;
62 private uint m_countFromQueue = 0; 63 private uint m_countFromQueue = 0;
63 private uint[] m_queueCounts = { 8, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 1 }; 64 // first queues are imediate, so no counts
65 private uint[] m_queueCounts = {0, 0, 8, 4, 4, 2, 2, 2, 2, 1, 1, 1};
64 66
65 // next request is a counter of the number of updates queued, it provides 67 // next request is a counter of the number of updates queued, it provides
66 // a total ordering on the updates coming through the queue and is more 68 // a total ordering on the updates coming through the queue and is more
@@ -137,7 +139,7 @@ namespace OpenSim.Framework
137 /// </summary> 139 /// </summary>
138 public bool TryDequeue(out IEntityUpdate value, out Int32 timeinqueue) 140 public bool TryDequeue(out IEntityUpdate value, out Int32 timeinqueue)
139 { 141 {
140 // If there is anything in priority queue 0, return it first no 142 // If there is anything in imediate queues, return it first no
141 // matter what else. Breaks fairness. But very useful. 143 // matter what else. Breaks fairness. But very useful.
142 for (int iq = 0; iq < NumberOfImmediateQueues; iq++) 144 for (int iq = 0; iq < NumberOfImmediateQueues; iq++)
143 { 145 {
@@ -172,14 +174,13 @@ namespace OpenSim.Framework
172 } 174 }
173 175
174 // Find the next non-immediate queue with updates in it 176 // Find the next non-immediate queue with updates in it
175 for (int i = 0; i < NumberOfQueues; ++i) 177 for (uint i = NumberOfImmediateQueues; i < NumberOfQueues; ++i)
176 { 178 {
177 m_nextQueue = (uint)((m_nextQueue + 1) % NumberOfQueues); 179 m_nextQueue++;
178 m_countFromQueue = m_queueCounts[m_nextQueue]; 180 if(m_nextQueue >= NumberOfQueues)
181 m_nextQueue = NumberOfImmediateQueues;
179 182
180 // if this is one of the immediate queues, just skip it 183 m_countFromQueue = m_queueCounts[m_nextQueue];
181 if (m_nextQueue < NumberOfImmediateQueues)
182 continue;
183 184
184 if (m_heaps[m_nextQueue].Count > 0) 185 if (m_heaps[m_nextQueue].Count > 0)
185 { 186 {
@@ -189,7 +190,6 @@ namespace OpenSim.Framework
189 m_lookupTable.Remove(item.Value.Entity.LocalId); 190 m_lookupTable.Remove(item.Value.Entity.LocalId);
190 timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime); 191 timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime);
191 value = item.Value; 192 value = item.Value;
192
193 return true; 193 return true;
194 } 194 }
195 } 195 }
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 29593e5..1d35b1a 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -334,6 +334,7 @@ namespace OpenSim.Framework.Servers.HttpServer
334 StreamReader reader = new StreamReader(requestStream, encoding); 334 StreamReader reader = new StreamReader(requestStream, encoding);
335 335
336 string requestBody = reader.ReadToEnd(); 336 string requestBody = reader.ReadToEnd();
337 reader.Close();
337 338
338 Hashtable keysvals = new Hashtable(); 339 Hashtable keysvals = new Hashtable();
339 Hashtable headervals = new Hashtable(); 340 Hashtable headervals = new Hashtable();
@@ -648,7 +649,7 @@ namespace OpenSim.Framework.Servers.HttpServer
648 // Every month or so this will wrap and give bad numbers, not really a problem 649 // Every month or so this will wrap and give bad numbers, not really a problem
649 // since its just for reporting 650 // since its just for reporting
650 int tickdiff = requestEndTick - requestStartTick; 651 int tickdiff = requestEndTick - requestStartTick;
651 if (tickdiff > 3000 && requestHandler.Name != "GetTexture") 652 if (tickdiff > 3000 && (requestHandler == null || requestHandler.Name == null || requestHandler.Name != "GetTexture"))
652 { 653 {
653 m_log.InfoFormat( 654 m_log.InfoFormat(
654 "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms", 655 "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms",
@@ -1555,6 +1556,8 @@ namespace OpenSim.Framework.Servers.HttpServer
1555 else 1556 else
1556 responseString = (string)responsedata["str_response_string"]; 1557 responseString = (string)responsedata["str_response_string"];
1557 contentType = (string)responsedata["content_type"]; 1558 contentType = (string)responsedata["content_type"];
1559 if (responseString == null)
1560 responseString = String.Empty;
1558 } 1561 }
1559 catch 1562 catch
1560 { 1563 {
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
index a80b1d7..d0a37d0 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
@@ -34,7 +34,7 @@ namespace OpenSim.Framework.Servers.HttpServer
34 public delegate void RequestMethod(UUID requestID, Hashtable request); 34 public delegate void RequestMethod(UUID requestID, Hashtable request);
35 public delegate bool HasEventsMethod(UUID requestID, UUID pId); 35 public delegate bool HasEventsMethod(UUID requestID, UUID pId);
36 36
37 public delegate Hashtable GetEventsMethod(UUID requestID, UUID pId, string request); 37 public delegate Hashtable GetEventsMethod(UUID requestID, UUID pId);
38 38
39 public delegate Hashtable NoEventsMethod(UUID requestID, UUID pId); 39 public delegate Hashtable NoEventsMethod(UUID requestID, UUID pId);
40 40
@@ -46,7 +46,7 @@ namespace OpenSim.Framework.Servers.HttpServer
46 public RequestMethod Request; 46 public RequestMethod Request;
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 50
51 public enum EventType : int 51 public enum EventType : int
52 { 52 {
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index db088e7..4be8bf4 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -33,6 +33,7 @@ using log4net;
33using HttpServer; 33using HttpServer;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Monitoring; 35using OpenSim.Framework.Monitoring;
36using Amib.Threading;
36 37
37 38
38/* 39/*
@@ -185,6 +186,8 @@ namespace OpenSim.Framework.Servers.HttpServer
185 private bool m_running = true; 186 private bool m_running = true;
186 private int slowCount = 0; 187 private int slowCount = 0;
187 188
189 private SmartThreadPool m_threadPool = new SmartThreadPool(20000, 12, 2);
190
188// private int m_timeout = 1000; // increase timeout 250; now use the event one 191// private int m_timeout = 1000; // increase timeout 250; now use the event one
189 192
190 public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout) 193 public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout)
@@ -202,7 +205,7 @@ namespace OpenSim.Framework.Servers.HttpServer
202 String.Format("PollServiceWorkerThread{0}", i), 205 String.Format("PollServiceWorkerThread{0}", i),
203 ThreadPriority.Normal, 206 ThreadPriority.Normal,
204 false, 207 false,
205 true, 208 false,
206 null, 209 null,
207 int.MaxValue); 210 int.MaxValue);
208 } 211 }
@@ -275,15 +278,7 @@ namespace OpenSim.Framework.Servers.HttpServer
275 Thread.Sleep(1000); // let the world move 278 Thread.Sleep(1000); // let the world move
276 279
277 foreach (Thread t in m_workerThreads) 280 foreach (Thread t in m_workerThreads)
278 { 281 Watchdog.AbortThread(t.ManagedThreadId);
279 try
280 {
281 t.Abort();
282 }
283 catch
284 {
285 }
286 }
287 282
288 try 283 try
289 { 284 {
@@ -326,13 +321,9 @@ namespace OpenSim.Framework.Servers.HttpServer
326 321
327 private void PoolWorkerJob() 322 private void PoolWorkerJob()
328 { 323 {
329 PollServiceHttpRequest req;
330 StreamReader str;
331
332// while (true)
333 while (m_running) 324 while (m_running)
334 { 325 {
335 req = m_requests.Dequeue(5000); 326 PollServiceHttpRequest req = m_requests.Dequeue(5000);
336 327
337 Watchdog.UpdateThread(); 328 Watchdog.UpdateThread();
338 if (req != null) 329 if (req != null)
@@ -341,35 +332,41 @@ namespace OpenSim.Framework.Servers.HttpServer
341 { 332 {
342 if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) 333 if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
343 { 334 {
344 try 335 Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id);
345 { 336
346 str = new StreamReader(req.Request.Body); 337 if (responsedata == null)
347 }
348 catch (System.ArgumentException)
349 {
350 // Stream was not readable means a child agent
351 // was closed due to logout, leaving the
352 // Event Queue request orphaned.
353 continue; 338 continue;
354 }
355 339
356 try 340 if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Normal)
357 { 341 {
358 Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); 342 try
359 DoHTTPGruntWork(m_server, req, responsedata); 343 {
344 DoHTTPGruntWork(m_server, req, responsedata);
345 }
346 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
347 {
348 // Ignore it, no need to reply
349 }
360 } 350 }
361 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream 351 else
362 { 352 {
363 // Ignore it, no need to reply 353 m_threadPool.QueueWorkItem(x =>
354 {
355 try
356 {
357 DoHTTPGruntWork(m_server, req, responsedata);
358 }
359 catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
360 {
361 // Ignore it, no need to reply
362 }
363
364 return null;
365 }, null);
364 } 366 }
365
366 str.Close();
367
368 } 367 }
369 else 368 else
370 { 369 {
371// if ((Environment.TickCount - req.RequestTime) > m_timeout)
372
373 if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) 370 if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
374 { 371 {
375 DoHTTPGruntWork(m_server, req, 372 DoHTTPGruntWork(m_server, req,