diff options
Diffstat (limited to 'OpenSim/Region')
11 files changed, 240 insertions, 86 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0862fcf..757e255 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -353,7 +353,18 @@ namespace OpenSim | |||
353 | if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true)) | 353 | if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true)) |
354 | WorkManager.JobEngine.Start(); | 354 | WorkManager.JobEngine.Start(); |
355 | 355 | ||
356 | m_httpServerPort = m_networkServersInfo.HttpListenerPort; | 356 | |
357 | if(m_networkServersInfo.HttpUsesSSL) | ||
358 | { | ||
359 | m_httpServerSSL = true; | ||
360 | m_httpServerPort = m_networkServersInfo.httpSSLPort; | ||
361 | } | ||
362 | else | ||
363 | { | ||
364 | m_httpServerSSL = false; | ||
365 | m_httpServerPort = m_networkServersInfo.HttpListenerPort; | ||
366 | } | ||
367 | |||
357 | SceneManager.OnRestartSim += HandleRestartRegion; | 368 | SceneManager.OnRestartSim += HandleRestartRegion; |
358 | 369 | ||
359 | // Only enable the watchdogs when all regions are ready. Otherwise we get false positives when cpu is | 370 | // Only enable the watchdogs when all regions are ready. Otherwise we get false positives when cpu is |
@@ -406,7 +417,18 @@ namespace OpenSim | |||
406 | 417 | ||
407 | // set initial ServerURI | 418 | // set initial ServerURI |
408 | regionInfo.HttpPort = m_httpServerPort; | 419 | regionInfo.HttpPort = m_httpServerPort; |
409 | regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString() + "/"; | 420 | if(m_httpServerSSL) |
421 | { | ||
422 | if(!m_httpServer.CheckSSLCertHost(regionInfo.ExternalHostName)) | ||
423 | throw new Exception("main http cert CN doesn't match region External IP"); | ||
424 | |||
425 | regionInfo.ServerURI = "https://" + regionInfo.ExternalHostName + | ||
426 | ":" + regionInfo.HttpPort.ToString() + "/"; | ||
427 | } | ||
428 | else | ||
429 | regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + | ||
430 | ":" + regionInfo.HttpPort.ToString() + "/"; | ||
431 | |||
410 | 432 | ||
411 | regionInfo.osSecret = m_osSecret; | 433 | regionInfo.osSecret = m_osSecret; |
412 | 434 | ||
@@ -1104,10 +1126,10 @@ namespace OpenSim | |||
1104 | MainConsole.Instance.Output("Joining the estate failed. Please try again."); | 1126 | MainConsole.Instance.Output("Joining the estate failed. Please try again."); |
1105 | } | 1127 | } |
1106 | } | 1128 | } |
1107 | } | 1129 | } |
1108 | 1130 | ||
1109 | return true; // need to update the database | 1131 | return true; // need to update the database |
1110 | } | 1132 | } |
1111 | } | 1133 | } |
1112 | 1134 | ||
1113 | public class OpenSimConfigSource | 1135 | public class OpenSimConfigSource |
diff --git a/OpenSim/Region/Application/RegionApplicationBase.cs b/OpenSim/Region/Application/RegionApplicationBase.cs index 83a9fff..7e8308e 100644 --- a/OpenSim/Region/Application/RegionApplicationBase.cs +++ b/OpenSim/Region/Application/RegionApplicationBase.cs | |||
@@ -50,6 +50,7 @@ namespace OpenSim | |||
50 | protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>(); | 50 | protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>(); |
51 | protected NetworkServersInfo m_networkServersInfo; | 51 | protected NetworkServersInfo m_networkServersInfo; |
52 | protected uint m_httpServerPort; | 52 | protected uint m_httpServerPort; |
53 | protected bool m_httpServerSSL; | ||
53 | protected ISimulationDataService m_simulationDataService; | 54 | protected ISimulationDataService m_simulationDataService; |
54 | protected IEstateDataService m_estateDataService; | 55 | protected IEstateDataService m_estateDataService; |
55 | 56 | ||
@@ -68,20 +69,37 @@ namespace OpenSim | |||
68 | 69 | ||
69 | Initialize(); | 70 | Initialize(); |
70 | 71 | ||
71 | m_httpServer | 72 | uint mainport = m_networkServersInfo.HttpListenerPort; |
72 | = new BaseHttpServer( | 73 | uint mainSSLport = m_networkServersInfo.httpSSLPort; |
73 | m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort, | ||
74 | m_networkServersInfo.HttpSSLCN); | ||
75 | 74 | ||
76 | if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort)) | 75 | if (m_networkServersInfo.HttpUsesSSL && (mainport == mainSSLport)) |
77 | { | 76 | { |
78 | m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); | 77 | m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports"); |
79 | } | 78 | } |
80 | 79 | ||
81 | m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort); | 80 | if(m_networkServersInfo.HttpUsesSSL) |
82 | m_httpServer.Start(); | 81 | { |
82 | m_httpServer = new BaseHttpServer( | ||
83 | mainSSLport, m_networkServersInfo.HttpUsesSSL, | ||
84 | m_networkServersInfo.HttpSSLCN, | ||
85 | m_networkServersInfo.HttpSSLCertPath, m_networkServersInfo.HttpSSLCNCertPass); | ||
86 | m_httpServer.Start(true,true); | ||
87 | MainServer.AddHttpServer(m_httpServer); | ||
88 | } | ||
89 | |||
90 | // unsecure main server | ||
91 | BaseHttpServer server = new BaseHttpServer(mainport); | ||
92 | if(!m_networkServersInfo.HttpUsesSSL) | ||
93 | { | ||
94 | m_httpServer = server; | ||
95 | server.Start(true, true); | ||
96 | } | ||
97 | else | ||
98 | server.Start(false, false); | ||
99 | |||
100 | MainServer.AddHttpServer(server); | ||
101 | MainServer.ÚnSecureInstance = server; | ||
83 | 102 | ||
84 | MainServer.AddHttpServer(m_httpServer); | ||
85 | MainServer.Instance = m_httpServer; | 103 | MainServer.Instance = m_httpServer; |
86 | 104 | ||
87 | // "OOB" Server | 105 | // "OOB" Server |
@@ -89,22 +107,22 @@ namespace OpenSim | |||
89 | { | 107 | { |
90 | if (!m_networkServersInfo.ssl_external) | 108 | if (!m_networkServersInfo.ssl_external) |
91 | { | 109 | { |
92 | BaseHttpServer server = new BaseHttpServer( | 110 | server = new BaseHttpServer( |
93 | m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, | 111 | m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, |
112 | m_networkServersInfo.cert_path, | ||
94 | m_networkServersInfo.cert_pass); | 113 | m_networkServersInfo.cert_pass); |
95 | 114 | ||
96 | m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); | 115 | m_log.InfoFormat("[REGION SERVER]: Starting OOB HTTPS server on port {0}", server.SSLPort); |
116 | server.Start(false, false); | ||
97 | MainServer.AddHttpServer(server); | 117 | MainServer.AddHttpServer(server); |
98 | server.Start(); | ||
99 | } | 118 | } |
100 | else | 119 | else |
101 | { | 120 | { |
102 | BaseHttpServer server = new BaseHttpServer( | 121 | server = new BaseHttpServer(m_networkServersInfo.https_port); |
103 | m_networkServersInfo.https_port); | ||
104 | 122 | ||
105 | m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port); | 123 | m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port); |
124 | server.Start(false, false); | ||
106 | MainServer.AddHttpServer(server); | 125 | MainServer.AddHttpServer(server); |
107 | server.Start(); | ||
108 | } | 126 | } |
109 | } | 127 | } |
110 | 128 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 1feece1..aced734 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | |||
@@ -372,7 +372,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
372 | 372 | ||
373 | caps.RegisterPollHandler( | 373 | caps.RegisterPollHandler( |
374 | "EventQueueGet", | 374 | "EventQueueGet", |
375 | new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, agentID, SERVER_EQ_TIME_NO_EVENTS)); | 375 | new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, Drop, agentID, SERVER_EQ_TIME_NO_EVENTS)); |
376 | } | 376 | } |
377 | 377 | ||
378 | public bool HasEvents(UUID requestID, UUID agentID) | 378 | public bool HasEvents(UUID requestID, UUID agentID) |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs index ee3f4f1..b23bffc 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs | |||
@@ -59,13 +59,12 @@ namespace OpenSim.Region.ClientStack.Linden.Tests | |||
59 | base.SetUp(); | 59 | base.SetUp(); |
60 | 60 | ||
61 | uint port = 9999; | 61 | uint port = 9999; |
62 | uint sslPort = 9998; | ||
63 | 62 | ||
64 | // This is an unfortunate bit of clean up we have to do because MainServer manages things through static | 63 | // This is an unfortunate bit of clean up we have to do because MainServer manages things through static |
65 | // variables and the VM is not restarted between tests. | 64 | // variables and the VM is not restarted between tests. |
66 | MainServer.RemoveHttpServer(port); | 65 | MainServer.RemoveHttpServer(port); |
67 | 66 | ||
68 | BaseHttpServer server = new BaseHttpServer(port, false, sslPort, ""); | 67 | BaseHttpServer server = new BaseHttpServer(port, false, "","",""); |
69 | MainServer.AddHttpServer(server); | 68 | MainServer.AddHttpServer(server); |
70 | MainServer.Instance = server; | 69 | MainServer.Instance = server; |
71 | 70 | ||
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index 69ff713..f733972 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | |||
@@ -76,7 +76,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
76 | { | 76 | { |
77 | public Hashtable response; | 77 | public Hashtable response; |
78 | public int bytes; | 78 | public int bytes; |
79 | public int lod; | ||
80 | } | 79 | } |
81 | 80 | ||
82 | 81 | ||
@@ -228,11 +227,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
228 | new List<Hashtable>(); | 227 | new List<Hashtable>(); |
229 | private Dictionary<UUID, aPollResponse> responses = | 228 | private Dictionary<UUID, aPollResponse> responses = |
230 | new Dictionary<UUID, aPollResponse>(); | 229 | new Dictionary<UUID, aPollResponse>(); |
230 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); | ||
231 | 231 | ||
232 | private Scene m_scene; | 232 | private Scene m_scene; |
233 | private MeshCapsDataThrottler m_throttler; | 233 | private MeshCapsDataThrottler m_throttler; |
234 | public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : | 234 | public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) : |
235 | base(null, uri, null, null, null, pId, int.MaxValue) | 235 | base(null, uri, null, null, null, null, pId, int.MaxValue) |
236 | { | 236 | { |
237 | m_scene = scene; | 237 | m_scene = scene; |
238 | m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId); | 238 | m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId); |
@@ -247,6 +247,17 @@ namespace OpenSim.Region.ClientStack.Linden | |||
247 | 247 | ||
248 | } | 248 | } |
249 | }; | 249 | }; |
250 | |||
251 | Drop = (x, y) => | ||
252 | { | ||
253 | lock (responses) | ||
254 | { | ||
255 | responses.Remove(x); | ||
256 | lock(dropedResponses) | ||
257 | dropedResponses.Add(x); | ||
258 | } | ||
259 | }; | ||
260 | |||
250 | GetEvents = (x, y) => | 261 | GetEvents = (x, y) => |
251 | { | 262 | { |
252 | lock (responses) | 263 | lock (responses) |
@@ -304,30 +315,48 @@ namespace OpenSim.Region.ClientStack.Linden | |||
304 | if(m_scene.ShuttingDown) | 315 | if(m_scene.ShuttingDown) |
305 | return; | 316 | return; |
306 | 317 | ||
307 | // If the avatar is gone, don't bother to get the texture | 318 | lock(responses) |
308 | if (m_scene.GetScenePresence(Id) == null) | ||
309 | { | 319 | { |
310 | response = new Hashtable(); | 320 | lock(dropedResponses) |
311 | 321 | { | |
312 | response["int_response_code"] = 500; | 322 | if(dropedResponses.Contains(requestID)) |
313 | response["str_response_string"] = "Script timeout"; | 323 | { |
314 | response["content_type"] = "text/plain"; | 324 | dropedResponses.Remove(requestID); |
315 | response["keepalive"] = false; | 325 | return; |
316 | response["reusecontext"] = false; | 326 | } |
327 | } | ||
328 | |||
329 | // If the avatar is gone, don't bother to get the texture | ||
330 | if (m_scene.GetScenePresence(Id) == null) | ||
331 | { | ||
332 | response = new Hashtable(); | ||
317 | 333 | ||
318 | lock (responses) | 334 | response["int_response_code"] = 500; |
319 | responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 }; | 335 | response["str_response_string"] = "Script timeout"; |
336 | response["content_type"] = "text/plain"; | ||
337 | response["keepalive"] = false; | ||
338 | responses[requestID] = new aPollResponse() { bytes = 0, response = response}; | ||
320 | 339 | ||
321 | return; | 340 | return; |
341 | } | ||
322 | } | 342 | } |
323 | 343 | ||
324 | response = m_getMeshHandler.Handle(requestinfo.request); | 344 | response = m_getMeshHandler.Handle(requestinfo.request); |
345 | |||
325 | lock (responses) | 346 | lock (responses) |
326 | { | 347 | { |
348 | lock(dropedResponses) | ||
349 | { | ||
350 | if(dropedResponses.Contains(requestID)) | ||
351 | { | ||
352 | dropedResponses.Remove(requestID); | ||
353 | return; | ||
354 | } | ||
355 | } | ||
356 | |||
327 | responses[requestID] = new aPollResponse() | 357 | responses[requestID] = new aPollResponse() |
328 | { | 358 | { |
329 | bytes = (int)response["int_bytes"], | 359 | bytes = (int)response["int_bytes"], |
330 | lod = (int)response["int_lod"], | ||
331 | response = response | 360 | response = response |
332 | }; | 361 | }; |
333 | 362 | ||
@@ -396,7 +425,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
396 | private volatile int lastTimeElapsed = 0; | 425 | private volatile int lastTimeElapsed = 0; |
397 | private volatile int BytesSent = 0; | 426 | private volatile int BytesSent = 0; |
398 | private int CapSetThrottle = 0; | 427 | private int CapSetThrottle = 0; |
399 | private float CapThrottleDistributon = 0.30f; | ||
400 | private readonly Scene m_scene; | 428 | private readonly Scene m_scene; |
401 | private ThrottleOutPacketType Throttle; | 429 | private ThrottleOutPacketType Throttle; |
402 | private readonly UUID User; | 430 | private readonly UUID User; |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index 0c20e04..c9f3b7e 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | |||
@@ -218,11 +218,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
218 | new List<Hashtable>(); | 218 | new List<Hashtable>(); |
219 | private Dictionary<UUID, aPollResponse> responses = | 219 | private Dictionary<UUID, aPollResponse> responses = |
220 | new Dictionary<UUID, aPollResponse>(); | 220 | new Dictionary<UUID, aPollResponse>(); |
221 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); | ||
221 | 222 | ||
222 | private Scene m_scene; | 223 | private Scene m_scene; |
223 | private CapsDataThrottler m_throttler = new CapsDataThrottler(100000, 1400000,10000); | 224 | private CapsDataThrottler m_throttler = new CapsDataThrottler(100000, 1400000,10000); |
224 | public PollServiceTextureEventArgs(UUID pId, Scene scene) : | 225 | public PollServiceTextureEventArgs(UUID pId, Scene scene) : |
225 | base(null, "", null, null, null, pId, int.MaxValue) | 226 | base(null, "", null, null, null, null, pId, int.MaxValue) |
226 | { | 227 | { |
227 | m_scene = scene; | 228 | m_scene = scene; |
228 | // x is request id, y is userid | 229 | // x is request id, y is userid |
@@ -236,6 +237,16 @@ namespace OpenSim.Region.ClientStack.Linden | |||
236 | 237 | ||
237 | } | 238 | } |
238 | }; | 239 | }; |
240 | |||
241 | Drop = (x, y) => | ||
242 | { | ||
243 | lock (responses) | ||
244 | { | ||
245 | responses.Remove(x); | ||
246 | dropedResponses.Add(x); | ||
247 | } | ||
248 | }; | ||
249 | |||
239 | GetEvents = (x, y) => | 250 | GetEvents = (x, y) => |
240 | { | 251 | { |
241 | lock (responses) | 252 | lock (responses) |
@@ -304,53 +315,72 @@ namespace OpenSim.Region.ClientStack.Linden | |||
304 | if(m_scene.ShuttingDown) | 315 | if(m_scene.ShuttingDown) |
305 | return; | 316 | return; |
306 | 317 | ||
307 | if (requestinfo.send503) | 318 | lock (responses) |
308 | { | 319 | { |
309 | response = new Hashtable(); | 320 | lock(dropedResponses) |
321 | { | ||
322 | if(dropedResponses.Contains(requestID)) | ||
323 | { | ||
324 | dropedResponses.Remove(requestID); | ||
325 | return; | ||
326 | } | ||
327 | } | ||
310 | 328 | ||
311 | response["int_response_code"] = 503; | 329 | if (requestinfo.send503) |
312 | response["str_response_string"] = "Throttled"; | 330 | { |
313 | response["content_type"] = "text/plain"; | 331 | response = new Hashtable(); |
314 | response["keepalive"] = false; | ||
315 | response["reusecontext"] = false; | ||
316 | 332 | ||
317 | Hashtable headers = new Hashtable(); | 333 | response["int_response_code"] = 503; |
318 | headers["Retry-After"] = 30; | 334 | response["str_response_string"] = "Throttled"; |
319 | response["headers"] = headers; | 335 | response["content_type"] = "text/plain"; |
336 | response["keepalive"] = false; | ||
337 | response["reusecontext"] = false; | ||
338 | |||
339 | Hashtable headers = new Hashtable(); | ||
340 | headers["Retry-After"] = 30; | ||
341 | response["headers"] = headers; | ||
320 | 342 | ||
321 | lock (responses) | ||
322 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; | 343 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; |
323 | 344 | ||
324 | return; | 345 | return; |
325 | } | 346 | } |
326 | 347 | ||
327 | // If the avatar is gone, don't bother to get the texture | 348 | // If the avatar is gone, don't bother to get the texture |
328 | if (m_scene.GetScenePresence(Id) == null) | 349 | if (m_scene.GetScenePresence(Id) == null) |
329 | { | 350 | { |
330 | response = new Hashtable(); | 351 | response = new Hashtable(); |
331 | 352 | ||
332 | response["int_response_code"] = 500; | 353 | response["int_response_code"] = 500; |
333 | response["str_response_string"] = "Script timeout"; | 354 | response["str_response_string"] = "Script timeout"; |
334 | response["content_type"] = "text/plain"; | 355 | response["content_type"] = "text/plain"; |
335 | response["keepalive"] = false; | 356 | response["keepalive"] = false; |
336 | response["reusecontext"] = false; | 357 | response["reusecontext"] = false; |
337 | 358 | ||
338 | lock (responses) | ||
339 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; | 359 | responses[requestID] = new aPollResponse() {bytes = 0, response = response}; |
340 | 360 | ||
341 | return; | 361 | return; |
362 | } | ||
342 | } | 363 | } |
343 | 364 | ||
344 | response = m_getTextureHandler.Handle(requestinfo.request); | 365 | response = m_getTextureHandler.Handle(requestinfo.request); |
366 | |||
345 | lock (responses) | 367 | lock (responses) |
346 | { | 368 | { |
369 | lock(dropedResponses) | ||
370 | { | ||
371 | if(dropedResponses.Contains(requestID)) | ||
372 | { | ||
373 | dropedResponses.Remove(requestID); | ||
374 | m_throttler.ProcessTime(); | ||
375 | return; | ||
376 | } | ||
377 | } | ||
347 | responses[requestID] = new aPollResponse() | 378 | responses[requestID] = new aPollResponse() |
348 | { | 379 | { |
349 | bytes = (int) response["int_bytes"], | 380 | bytes = (int) response["int_bytes"], |
350 | response = response | 381 | response = response |
351 | }; | 382 | }; |
352 | 383 | } | |
353 | } | ||
354 | m_throttler.ProcessTime(); | 384 | m_throttler.ProcessTime(); |
355 | } | 385 | } |
356 | 386 | ||
@@ -423,7 +453,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
423 | 453 | ||
424 | internal sealed class CapsDataThrottler | 454 | internal sealed class CapsDataThrottler |
425 | { | 455 | { |
426 | |||
427 | private volatile int currenttime = 0; | 456 | private volatile int currenttime = 0; |
428 | private volatile int lastTimeElapsed = 0; | 457 | private volatile int lastTimeElapsed = 0; |
429 | private volatile int BytesSent = 0; | 458 | private volatile int BytesSent = 0; |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index e0ec842..1ea0454 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs | |||
@@ -61,7 +61,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
61 | public UUID reqID; | 61 | public UUID reqID; |
62 | public Hashtable request; | 62 | public Hashtable request; |
63 | public ScenePresence presence; | 63 | public ScenePresence presence; |
64 | public List<UUID> folders; | ||
65 | } | 64 | } |
66 | 65 | ||
67 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 66 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -250,17 +249,28 @@ namespace OpenSim.Region.ClientStack.Linden | |||
250 | { | 249 | { |
251 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 250 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
252 | 251 | ||
253 | private Dictionary<UUID, Hashtable> responses = | 252 | private Dictionary<UUID, Hashtable> responses = new Dictionary<UUID, Hashtable>(); |
254 | new Dictionary<UUID, Hashtable>(); | 253 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); |
255 | 254 | ||
256 | private WebFetchInvDescModule m_module; | 255 | private WebFetchInvDescModule m_module; |
257 | 256 | ||
258 | public PollServiceInventoryEventArgs(WebFetchInvDescModule module, string url, UUID pId) : | 257 | public PollServiceInventoryEventArgs(WebFetchInvDescModule module, string url, UUID pId) : |
259 | base(null, url, null, null, null, pId, int.MaxValue) | 258 | base(null, url, null, null, null, null, pId, int.MaxValue) |
260 | { | 259 | { |
261 | m_module = module; | 260 | m_module = module; |
262 | 261 | ||
263 | HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; | 262 | HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); }; |
263 | |||
264 | Drop = (x, y) => | ||
265 | { | ||
266 | lock (responses) | ||
267 | { | ||
268 | responses.Remove(x); | ||
269 | lock(dropedResponses) | ||
270 | dropedResponses.Add(x); | ||
271 | } | ||
272 | }; | ||
273 | |||
264 | GetEvents = (x, y) => | 274 | GetEvents = (x, y) => |
265 | { | 275 | { |
266 | lock (responses) | 276 | lock (responses) |
@@ -285,8 +295,10 @@ namespace OpenSim.Region.ClientStack.Linden | |||
285 | reqinfo.reqID = x; | 295 | reqinfo.reqID = x; |
286 | reqinfo.request = y; | 296 | reqinfo.request = y; |
287 | reqinfo.presence = sp; | 297 | reqinfo.presence = sp; |
288 | reqinfo.folders = new List<UUID>(); | ||
289 | 298 | ||
299 | /* why where we doing this? just to get cof ? | ||
300 | List<UUID> folders = new List<UUID>(); | ||
301 | |||
290 | // Decode the request here | 302 | // Decode the request here |
291 | string request = y["body"].ToString(); | 303 | string request = y["body"].ToString(); |
292 | 304 | ||
@@ -322,11 +334,11 @@ namespace OpenSim.Region.ClientStack.Linden | |||
322 | UUID folderID; | 334 | UUID folderID; |
323 | if (UUID.TryParse(folder, out folderID)) | 335 | if (UUID.TryParse(folder, out folderID)) |
324 | { | 336 | { |
325 | if (!reqinfo.folders.Contains(folderID)) | 337 | if (!folders.Contains(folderID)) |
326 | { | 338 | { |
327 | if (sp.COF != UUID.Zero && sp.COF == folderID) | 339 | if (sp.COF != UUID.Zero && sp.COF == folderID) |
328 | highPriority = true; | 340 | highPriority = true; |
329 | reqinfo.folders.Add(folderID); | 341 | folders.Add(folderID); |
330 | } | 342 | } |
331 | } | 343 | } |
332 | } | 344 | } |
@@ -334,6 +346,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
334 | if (highPriority) | 346 | if (highPriority) |
335 | m_queue.PriorityEnqueue(reqinfo); | 347 | m_queue.PriorityEnqueue(reqinfo); |
336 | else | 348 | else |
349 | */ | ||
337 | m_queue.Enqueue(reqinfo); | 350 | m_queue.Enqueue(reqinfo); |
338 | }; | 351 | }; |
339 | 352 | ||
@@ -365,6 +378,19 @@ namespace OpenSim.Region.ClientStack.Linden | |||
365 | 378 | ||
366 | UUID requestID = requestinfo.reqID; | 379 | UUID requestID = requestinfo.reqID; |
367 | 380 | ||
381 | |||
382 | lock(responses) | ||
383 | { | ||
384 | lock(dropedResponses) | ||
385 | { | ||
386 | if(dropedResponses.Contains(requestID)) | ||
387 | { | ||
388 | dropedResponses.Remove(requestID); | ||
389 | return; | ||
390 | } | ||
391 | } | ||
392 | } | ||
393 | |||
368 | Hashtable response = new Hashtable(); | 394 | Hashtable response = new Hashtable(); |
369 | 395 | ||
370 | response["int_response_code"] = 200; | 396 | response["int_response_code"] = 200; |
@@ -377,11 +403,21 @@ namespace OpenSim.Region.ClientStack.Linden | |||
377 | 403 | ||
378 | lock (responses) | 404 | lock (responses) |
379 | { | 405 | { |
406 | lock(dropedResponses) | ||
407 | { | ||
408 | if(dropedResponses.Contains(requestID)) | ||
409 | { | ||
410 | dropedResponses.Remove(requestID); | ||
411 | requestinfo.request.Clear(); | ||
412 | WebFetchInvDescModule.ProcessedRequestsCount++; | ||
413 | return; | ||
414 | } | ||
415 | } | ||
416 | |||
380 | if (responses.ContainsKey(requestID)) | 417 | if (responses.ContainsKey(requestID)) |
381 | m_log.WarnFormat("[FETCH INVENTORY DESCENDENTS2 MODULE]: Caught in the act of loosing responses! Please report this on mantis #7054"); | 418 | m_log.WarnFormat("[FETCH INVENTORY DESCENDENTS2 MODULE]: Caught in the act of loosing responses! Please report this on mantis #7054"); |
382 | responses[requestID] = response; | 419 | responses[requestID] = response; |
383 | } | 420 | } |
384 | requestinfo.folders.Clear(); | ||
385 | requestinfo.request.Clear(); | 421 | requestinfo.request.Clear(); |
386 | WebFetchInvDescModule.ProcessedRequestsCount++; | 422 | WebFetchInvDescModule.ProcessedRequestsCount++; |
387 | } | 423 | } |
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 895020c..66ebdbe 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -273,7 +273,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
273 | string uri = "/lslhttp/" + urlcode.ToString() + "/"; | 273 | string uri = "/lslhttp/" + urlcode.ToString() + "/"; |
274 | 274 | ||
275 | PollServiceEventArgs args | 275 | PollServiceEventArgs args |
276 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000); | 276 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); |
277 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 277 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
278 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); | 278 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); |
279 | 279 | ||
@@ -331,7 +331,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
331 | string uri = "/lslhttps/" + urlcode.ToString() + "/"; | 331 | string uri = "/lslhttps/" + urlcode.ToString() + "/"; |
332 | 332 | ||
333 | PollServiceEventArgs args | 333 | PollServiceEventArgs args |
334 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000); | 334 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); |
335 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 335 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
336 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); | 336 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); |
337 | 337 | ||
@@ -585,6 +585,28 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
585 | } | 585 | } |
586 | } | 586 | } |
587 | } | 587 | } |
588 | |||
589 | protected void Drop(UUID requestID, UUID sessionID) | ||
590 | { | ||
591 | UrlData url = null; | ||
592 | lock (m_RequestMap) | ||
593 | { | ||
594 | if (m_RequestMap.ContainsKey(requestID)) | ||
595 | { | ||
596 | url = m_RequestMap[requestID]; | ||
597 | m_RequestMap.Remove(requestID); | ||
598 | if(url != null) | ||
599 | { | ||
600 | lock (url.requests) | ||
601 | { | ||
602 | if(url.requests.ContainsKey(requestID)) | ||
603 | url.requests.Remove(requestID); | ||
604 | } | ||
605 | } | ||
606 | } | ||
607 | } | ||
608 | } | ||
609 | |||
588 | protected Hashtable GetEvents(UUID requestID, UUID sessionID) | 610 | protected Hashtable GetEvents(UUID requestID, UUID sessionID) |
589 | { | 611 | { |
590 | UrlData url = null; | 612 | UrlData url = null; |
@@ -744,9 +766,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
744 | else | 766 | else |
745 | { | 767 | { |
746 | queryString = queryString + val + "&"; | 768 | queryString = queryString + val + "&"; |
747 | } | ||
748 | } | 769 | } |
749 | } | 770 | } |
771 | } | ||
750 | if (queryString.Length > 1) | 772 | if (queryString.Length > 1) |
751 | queryString = queryString.Substring(0, queryString.Length - 1); | 773 | queryString = queryString.Substring(0, queryString.Length - 1); |
752 | 774 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 23da90a..60efc04 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -236,8 +236,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
236 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); | 236 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); |
237 | foreach (TaskInventoryItem item in items) | 237 | foreach (TaskInventoryItem item in items) |
238 | { | 238 | { |
239 | item.GroupID = groupID; | 239 | item.GroupID = groupID; |
240 | } | 240 | } |
241 | m_items.LockItemsForWrite(false); | 241 | m_items.LockItemsForWrite(false); |
242 | } | 242 | } |
243 | 243 | ||
diff --git a/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs index 50276ae..9273b20 100644 --- a/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs | |||
@@ -52,12 +52,12 @@ namespace OpenSim.Region.DataSnapshot | |||
52 | m_externalData = externalData; | 52 | m_externalData = externalData; |
53 | 53 | ||
54 | //Register HTTP handler | 54 | //Register HTTP handler |
55 | if (MainServer.Instance.AddHTTPHandler("collector", OnGetSnapshot)) | 55 | if (MainServer.ÚnSecureInstance.AddHTTPHandler("collector", OnGetSnapshot)) |
56 | { | 56 | { |
57 | m_log.Info("[DATASNAPSHOT]: Set up snapshot service"); | 57 | m_log.Info("[DATASNAPSHOT]: Set up snapshot service"); |
58 | } | 58 | } |
59 | // Register validation callback handler | 59 | // Register validation callback handler |
60 | MainServer.Instance.AddHTTPHandler("validate", OnValidate); | 60 | MainServer.ÚnSecureInstance.AddHTTPHandler("validate", OnValidate); |
61 | 61 | ||
62 | } | 62 | } |
63 | 63 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs index 241a24d..bafc0b3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs | |||
@@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
95 | config.Configs["Network"].Set("ExternalHostNameForLSL", "127.0.0.1"); | 95 | config.Configs["Network"].Set("ExternalHostNameForLSL", "127.0.0.1"); |
96 | m_scene = new SceneHelpers().SetupScene(); | 96 | m_scene = new SceneHelpers().SetupScene(); |
97 | 97 | ||
98 | BaseHttpServer server = new BaseHttpServer(port, false, 0, ""); | 98 | BaseHttpServer server = new BaseHttpServer(port); |
99 | MainServer.AddHttpServer(server); | 99 | MainServer.AddHttpServer(server); |
100 | MainServer.Instance = server; | 100 | MainServer.Instance = server; |
101 | 101 | ||