diff options
23 files changed, 144 insertions, 108 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs b/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs index 55a1996..4c10ac9 100644 --- a/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs +++ b/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs | |||
@@ -206,7 +206,7 @@ namespace OpenSim.Data.PGSQL | |||
206 | cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" | 206 | cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" |
207 | from inventoryitems | 207 | from inventoryitems |
208 | where ""avatarID""::uuid = :PrincipalID | 208 | where ""avatarID""::uuid = :PrincipalID |
209 | and ""assetID"" = :AssetID | 209 | and ""assetID""::uuid = :AssetID |
210 | group by ""assetID"" "); | 210 | group by ""assetID"" "); |
211 | 211 | ||
212 | cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID)); | 212 | cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID)); |
diff --git a/OpenSim/Framework/Client/IClientIPEndpoint.cs b/OpenSim/Framework/Client/IClientIPEndpoint.cs index 2b99bf0..2194616 100644 --- a/OpenSim/Framework/Client/IClientIPEndpoint.cs +++ b/OpenSim/Framework/Client/IClientIPEndpoint.cs | |||
@@ -34,6 +34,6 @@ namespace OpenSim.Framework.Client | |||
34 | { | 34 | { |
35 | public interface IClientIPEndpoint | 35 | public interface IClientIPEndpoint |
36 | { | 36 | { |
37 | IPAddress EndPoint { get; } | 37 | IPEndPoint RemoteEndPoint { get; } |
38 | } | 38 | } |
39 | } | 39 | } |
diff --git a/OpenSim/Framework/Monitoring/WorkManager.cs b/OpenSim/Framework/Monitoring/WorkManager.cs index 43130f9..a3e0390 100644 --- a/OpenSim/Framework/Monitoring/WorkManager.cs +++ b/OpenSim/Framework/Monitoring/WorkManager.cs | |||
@@ -82,6 +82,11 @@ namespace OpenSim.Framework.Monitoring | |||
82 | HandleControlCommand); | 82 | HandleControlCommand); |
83 | } | 83 | } |
84 | 84 | ||
85 | public static void Stop() | ||
86 | { | ||
87 | JobEngine.Stop(); | ||
88 | } | ||
89 | |||
85 | /// <summary> | 90 | /// <summary> |
86 | /// Start a new long-lived thread. | 91 | /// Start a new long-lived thread. |
87 | /// </summary> | 92 | /// </summary> |
@@ -131,7 +136,6 @@ namespace OpenSim.Framework.Monitoring | |||
131 | 136 | ||
132 | thread.Start(); | 137 | thread.Start(); |
133 | 138 | ||
134 | |||
135 | return thread; | 139 | return thread; |
136 | } | 140 | } |
137 | 141 | ||
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index c7f0136..2834d94 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -136,12 +136,19 @@ namespace OpenSim.Framework.Servers | |||
136 | 136 | ||
137 | protected override void ShutdownSpecific() | 137 | protected override void ShutdownSpecific() |
138 | { | 138 | { |
139 | m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); | ||
140 | 139 | ||
141 | RemovePIDFile(); | ||
142 | 140 | ||
143 | base.ShutdownSpecific(); | 141 | base.ShutdownSpecific(); |
144 | 142 | ||
143 | MainServer.Stop(); | ||
144 | |||
145 | Thread.Sleep(5000); | ||
146 | |||
147 | WorkManager.Stop(); | ||
148 | |||
149 | RemovePIDFile(); | ||
150 | m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); | ||
151 | |||
145 | if (!SuppressExit) | 152 | if (!SuppressExit) |
146 | Environment.Exit(0); | 153 | Environment.Exit(0); |
147 | } | 154 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index cb0c41f..94a9490 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -194,17 +194,20 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
194 | { | 194 | { |
195 | m_running = false; | 195 | m_running = false; |
196 | 196 | ||
197 | Thread.Sleep(1000); // let the world move | 197 | Thread.Sleep(100); // let the world move |
198 | 198 | ||
199 | foreach (Thread t in m_workerThreads) | 199 | foreach (Thread t in m_workerThreads) |
200 | Watchdog.AbortThread(t.ManagedThreadId); | 200 | Watchdog.AbortThread(t.ManagedThreadId); |
201 | 201 | ||
202 | m_threadPool.Shutdown(); | ||
203 | |||
202 | // any entry in m_bycontext should have a active request on the other queues | 204 | // any entry in m_bycontext should have a active request on the other queues |
203 | // so just delete contents to easy GC | 205 | // so just delete contents to easy GC |
204 | foreach (Queue<PollServiceHttpRequest> qu in m_bycontext.Values) | 206 | foreach (Queue<PollServiceHttpRequest> qu in m_bycontext.Values) |
205 | qu.Clear(); | 207 | qu.Clear(); |
206 | m_bycontext.Clear(); | 208 | m_bycontext.Clear(); |
207 | 209 | ||
210 | /* | ||
208 | try | 211 | try |
209 | { | 212 | { |
210 | foreach (PollServiceHttpRequest req in m_retryRequests) | 213 | foreach (PollServiceHttpRequest req in m_retryRequests) |
@@ -217,8 +220,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
217 | } | 220 | } |
218 | 221 | ||
219 | PollServiceHttpRequest wreq; | 222 | PollServiceHttpRequest wreq; |
223 | */ | ||
220 | m_retryRequests.Clear(); | 224 | m_retryRequests.Clear(); |
221 | 225 | /* | |
222 | while (m_requests.Count() > 0) | 226 | while (m_requests.Count() > 0) |
223 | { | 227 | { |
224 | try | 228 | try |
@@ -231,7 +235,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
231 | { | 235 | { |
232 | } | 236 | } |
233 | } | 237 | } |
234 | 238 | */ | |
235 | m_requests.Clear(); | 239 | m_requests.Clear(); |
236 | } | 240 | } |
237 | 241 | ||
@@ -242,7 +246,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
242 | while (m_running) | 246 | while (m_running) |
243 | { | 247 | { |
244 | PollServiceHttpRequest req = m_requests.Dequeue(5000); | 248 | PollServiceHttpRequest req = m_requests.Dequeue(5000); |
245 | |||
246 | Watchdog.UpdateThread(); | 249 | Watchdog.UpdateThread(); |
247 | if(req == null) | 250 | if(req == null) |
248 | continue; | 251 | continue; |
@@ -277,16 +280,16 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
277 | try | 280 | try |
278 | { | 281 | { |
279 | req.DoHTTPGruntWork(m_server, responsedata); | 282 | req.DoHTTPGruntWork(m_server, responsedata); |
283 | } | ||
284 | catch (ObjectDisposedException) { } | ||
285 | finally | ||
286 | { | ||
280 | if(req.HttpContext.CanSend() && req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Poll | 287 | if(req.HttpContext.CanSend() && req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Poll |
281 | && (Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | 288 | && (Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) |
282 | ReQueueEvent(req); | 289 | ReQueueEvent(req); |
283 | else | 290 | else |
284 | byContextDequeue(req); | 291 | byContextDequeue(req); |
285 | } | 292 | } |
286 | catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream | ||
287 | { | ||
288 | // Ignore it, no need to reply | ||
289 | } | ||
290 | return null; | 293 | return null; |
291 | }, null); | 294 | }, null); |
292 | } | 295 | } |
@@ -300,11 +303,11 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
300 | { | 303 | { |
301 | req.DoHTTPGruntWork(m_server, | 304 | req.DoHTTPGruntWork(m_server, |
302 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | 305 | req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); |
303 | byContextDequeue(req); | ||
304 | } | 306 | } |
305 | catch (ObjectDisposedException) | 307 | catch (ObjectDisposedException) {} |
308 | finally | ||
306 | { | 309 | { |
307 | // Ignore it, no need to reply | 310 | byContextDequeue(req); |
308 | } | 311 | } |
309 | return null; | 312 | return null; |
310 | }, null); | 313 | }, null); |
diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs index 29308a9..7ecd383 100644 --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs | |||
@@ -369,5 +369,17 @@ namespace OpenSim.Framework.Servers | |||
369 | return m_Servers[port]; | 369 | return m_Servers[port]; |
370 | } | 370 | } |
371 | } | 371 | } |
372 | |||
373 | public static void Stop() | ||
374 | { | ||
375 | lock (m_Servers) | ||
376 | { | ||
377 | foreach (BaseHttpServer httpServer in m_Servers.Values) | ||
378 | { | ||
379 | httpServer.Stop(); | ||
380 | } | ||
381 | } | ||
382 | } | ||
383 | |||
372 | } | 384 | } |
373 | } \ No newline at end of file | 385 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index bc6d7b3..4bd2c28 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -77,7 +77,11 @@ namespace OpenSim | |||
77 | if(Util.IsWindows()) | 77 | if(Util.IsWindows()) |
78 | ServicePointManager.DefaultConnectionLimit = 32; | 78 | ServicePointManager.DefaultConnectionLimit = 32; |
79 | else | 79 | else |
80 | { | ||
80 | ServicePointManager.DefaultConnectionLimit = 12; | 81 | ServicePointManager.DefaultConnectionLimit = 12; |
82 | try { ServicePointManager.DnsRefreshTimeout = 120000; } // just is case crazy some mono decides to have it infinity | ||
83 | catch { } | ||
84 | } | ||
81 | 85 | ||
82 | ServicePointManager.Expect100Continue = false; | 86 | ServicePointManager.Expect100Continue = false; |
83 | ServicePointManager.UseNagleAlgorithm = false; | 87 | ServicePointManager.UseNagleAlgorithm = false; |
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index f9f103a..524f2be 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -504,7 +504,8 @@ namespace OpenSim | |||
504 | private void WatchdogTimeoutHandler(Watchdog.ThreadWatchdogInfo twi) | 504 | private void WatchdogTimeoutHandler(Watchdog.ThreadWatchdogInfo twi) |
505 | { | 505 | { |
506 | int now = Environment.TickCount & Int32.MaxValue; | 506 | int now = Environment.TickCount & Int32.MaxValue; |
507 | 507 | if(twi.Thread.ThreadState == System.Threading.ThreadState.Stopped) | |
508 | return; | ||
508 | m_log.ErrorFormat( | 509 | m_log.ErrorFormat( |
509 | "[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago. {3}", | 510 | "[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago. {3}", |
510 | twi.Thread.Name, | 511 | twi.Thread.Name, |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 298c933..f658a70 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
62 | /// Handles new client connections | 62 | /// Handles new client connections |
63 | /// Constructor takes a single Packet and authenticates everything | 63 | /// Constructor takes a single Packet and authenticates everything |
64 | /// </summary> | 64 | /// </summary> |
65 | public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientInventory, IStatsCollector | 65 | public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientInventory, IStatsCollector, IClientIPEndpoint |
66 | { | 66 | { |
67 | /// <value> | 67 | /// <value> |
68 | /// Debug packet level. See OpenSim.RegisterConsoleCommands() for more details. | 68 | /// Debug packet level. See OpenSim.RegisterConsoleCommands() for more details. |
diff --git a/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs b/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs index 8502006..b4c68e2 100644 --- a/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs +++ b/OpenSim/Region/CoreModules/Agent/IPBan/SceneBanner.cs | |||
@@ -53,9 +53,9 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan | |||
53 | if (bans.Count > 0) | 53 | if (bans.Count > 0) |
54 | { | 54 | { |
55 | IClientIPEndpoint ipEndpoint; | 55 | IClientIPEndpoint ipEndpoint; |
56 | if (client.TryGet(out ipEndpoint)) | 56 | if (client.TryGet(out ipEndpoint) && ipEndpoint.RemoteEndPoint != null) |
57 | { | 57 | { |
58 | IPAddress end = ipEndpoint.EndPoint; | 58 | IPAddress end = ipEndpoint.RemoteEndPoint.Address; |
59 | 59 | ||
60 | try | 60 | try |
61 | { | 61 | { |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 87b76dc..4b846f5 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -813,8 +813,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
813 | agentCircuit.Id0 = currentAgentCircuit.Id0; | 813 | agentCircuit.Id0 = currentAgentCircuit.Id0; |
814 | } | 814 | } |
815 | 815 | ||
816 | IClientIPEndpoint ipepClient; | ||
817 | |||
818 | uint newRegionX, newRegionY, oldRegionX, oldRegionY; | 816 | uint newRegionX, newRegionY, oldRegionX, oldRegionY; |
819 | Util.RegionHandleToRegionLoc(destinationHandle, out newRegionX, out newRegionY); | 817 | Util.RegionHandleToRegionLoc(destinationHandle, out newRegionX, out newRegionY); |
820 | Util.RegionHandleToRegionLoc(sourceRegion.RegionHandle, out oldRegionX, out oldRegionY); | 818 | Util.RegionHandleToRegionLoc(sourceRegion.RegionHandle, out oldRegionX, out oldRegionY); |
@@ -833,13 +831,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
833 | finalDestination.RegionName, newRegionX, newRegionY,newSizeX, newSizeY, sp.Name, Scene.Name); | 831 | finalDestination.RegionName, newRegionX, newRegionY,newSizeX, newSizeY, sp.Name, Scene.Name); |
834 | 832 | ||
835 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); | 833 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); |
836 | #region IP Translation for NAT | ||
837 | // Uses ipepClient above | ||
838 | if (sp.ClientView.TryGet(out ipepClient)) | ||
839 | { | ||
840 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); | ||
841 | } | ||
842 | #endregion | ||
843 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); | 834 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); |
844 | } | 835 | } |
845 | else | 836 | else |
@@ -952,7 +943,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
952 | agent.Position = agentCircuit.startpos; | 943 | agent.Position = agentCircuit.startpos; |
953 | SetCallbackURL(agent, sp.Scene.RegionInfo); | 944 | SetCallbackURL(agent, sp.Scene.RegionInfo); |
954 | 945 | ||
955 | |||
956 | // We will check for an abort before UpdateAgent since UpdateAgent will require an active viewer to | 946 | // We will check for an abort before UpdateAgent since UpdateAgent will require an active viewer to |
957 | // establish th econnection to the destination which makes it return true. | 947 | // establish th econnection to the destination which makes it return true. |
958 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 948 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
@@ -1745,11 +1735,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1745 | 1735 | ||
1746 | if (m_eqModule != null) | 1736 | if (m_eqModule != null) |
1747 | { | 1737 | { |
1748 | #region IP Translation for NAT | ||
1749 | IClientIPEndpoint ipepClient; | ||
1750 | if (agent.ClientView.TryGet(out ipepClient)) | ||
1751 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); | ||
1752 | |||
1753 | m_log.DebugFormat("{0} {1} is sending {2} EnableSimulator for neighbour region {3}(loc=<{4},{5}>,siz=<{6},{7}>) " + | 1738 | m_log.DebugFormat("{0} {1} is sending {2} EnableSimulator for neighbour region {3}(loc=<{4},{5}>,siz=<{6},{7}>) " + |
1754 | "and EstablishAgentCommunication with seed cap {8}", LogHeader, | 1739 | "and EstablishAgentCommunication with seed cap {8}", LogHeader, |
1755 | source.RegionName, agent.Name, | 1740 | source.RegionName, agent.Name, |
@@ -2281,6 +2266,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2281 | } | 2266 | } |
2282 | 2267 | ||
2283 | #endregion // NotFoundLocationCache class | 2268 | #endregion // NotFoundLocationCache class |
2269 | #region getregions | ||
2284 | private NotFoundLocationCache m_notFoundLocationCache = new NotFoundLocationCache(); | 2270 | private NotFoundLocationCache m_notFoundLocationCache = new NotFoundLocationCache(); |
2285 | 2271 | ||
2286 | protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, double px, double py) | 2272 | protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, double px, double py) |
@@ -2398,17 +2384,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2398 | 2384 | ||
2399 | if (m_eqModule != null) | 2385 | if (m_eqModule != null) |
2400 | { | 2386 | { |
2401 | #region IP Translation for NAT | ||
2402 | if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened | 2387 | if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened |
2403 | return; | 2388 | return; |
2404 | 2389 | ||
2405 | IClientIPEndpoint ipepClient; | ||
2406 | if (sp.ClientView.TryGet(out ipepClient)) | ||
2407 | { | ||
2408 | endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); | ||
2409 | } | ||
2410 | #endregion | ||
2411 | |||
2412 | m_log.DebugFormat("{0} {1} is sending {2} EnableSimulator for neighbour region {3}(loc=<{4},{5}>,siz=<{6},{7}>) " + | 2390 | m_log.DebugFormat("{0} {1} is sending {2} EnableSimulator for neighbour region {3}(loc=<{4},{5}>,siz=<{6},{7}>) " + |
2413 | "and EstablishAgentCommunication with seed cap {8}", LogHeader, | 2391 | "and EstablishAgentCommunication with seed cap {8}", LogHeader, |
2414 | scene.RegionInfo.RegionName, sp.Name, | 2392 | scene.RegionInfo.RegionName, sp.Name, |
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs index 5d66d34..8c44ee2 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs | |||
@@ -106,6 +106,8 @@ namespace OpenSim.Region.CoreModules.Hypergrid | |||
106 | if (!m_Enabled) | 106 | if (!m_Enabled) |
107 | return; | 107 | return; |
108 | 108 | ||
109 | base.RemoveRegion(scene); | ||
110 | |||
109 | scene.EventManager.OnClientClosed -= EventManager_OnClientClosed; | 111 | scene.EventManager.OnClientClosed -= EventManager_OnClientClosed; |
110 | } | 112 | } |
111 | 113 | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index ae5e175..57dc556 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -415,6 +415,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
415 | 415 | ||
416 | public void Close() | 416 | public void Close() |
417 | { | 417 | { |
418 | ThreadPool.Shutdown(); | ||
418 | } | 419 | } |
419 | 420 | ||
420 | public string Name | 421 | public string Name |
@@ -538,6 +539,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
538 | { | 539 | { |
539 | Request = (HttpWebRequest)WebRequest.Create(Url); | 540 | Request = (HttpWebRequest)WebRequest.Create(Url); |
540 | Request.AllowAutoRedirect = false; | 541 | Request.AllowAutoRedirect = false; |
542 | Request.KeepAlive = false; | ||
541 | 543 | ||
542 | //This works around some buggy HTTP Servers like Lighttpd | 544 | //This works around some buggy HTTP Servers like Lighttpd |
543 | Request.ServicePoint.Expect100Continue = false; | 545 | Request.ServicePoint.Expect100Continue = false; |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 5dcf326..00c8279 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -215,6 +215,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
215 | m_scene.EventManager.OnNewClient -= OnNewClient; | 215 | m_scene.EventManager.OnNewClient -= OnNewClient; |
216 | m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps; | 216 | m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps; |
217 | 217 | ||
218 | m_scene.UnregisterModuleInterface<IWorldMapModule>(this); | ||
219 | |||
218 | string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString(); | 220 | string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString(); |
219 | regionimage = regionimage.Replace("-", ""); | 221 | regionimage = regionimage.Replace("-", ""); |
220 | MainServer.Instance.RemoveLLSDHandler("/MAP/MapItems/" + m_scene.RegionInfo.RegionHandle.ToString(), | 222 | MainServer.Instance.RemoveLLSDHandler("/MAP/MapItems/" + m_scene.RegionInfo.RegionHandle.ToString(), |
@@ -1148,7 +1150,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1148 | List<MapBlockRequestData> thisRunData = new List<MapBlockRequestData>(); | 1150 | List<MapBlockRequestData> thisRunData = new List<MapBlockRequestData>(); |
1149 | while (true) | 1151 | while (true) |
1150 | { | 1152 | { |
1151 | m_mapBlockRequestEvent.WaitOne(); | 1153 | while(!m_mapBlockRequestEvent.WaitOne(4900)) |
1154 | { | ||
1155 | if(m_scene == null) | ||
1156 | return; | ||
1157 | } | ||
1158 | |||
1152 | lock (m_mapBlockRequestEvent) | 1159 | lock (m_mapBlockRequestEvent) |
1153 | { | 1160 | { |
1154 | int total = 0; | 1161 | int total = 0; |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 474378d..55ccb0a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -4687,7 +4687,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
4687 | cAgent.agentCOF = COF; | 4687 | cAgent.agentCOF = COF; |
4688 | cAgent.ActiveGroupID = ControllingClient.ActiveGroupId; | 4688 | cAgent.ActiveGroupID = ControllingClient.ActiveGroupId; |
4689 | cAgent.ActiveGroupName = ControllingClient.ActiveGroupName; | 4689 | cAgent.ActiveGroupName = ControllingClient.ActiveGroupName; |
4690 | cAgent.ActiveGroupTitle = Grouptitle; | 4690 | if(Grouptitle == null) |
4691 | cAgent.ActiveGroupTitle = String.Empty; | ||
4692 | else | ||
4693 | cAgent.ActiveGroupTitle = Grouptitle; | ||
4691 | } | 4694 | } |
4692 | } | 4695 | } |
4693 | 4696 | ||
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 93406cb..5a9a5a0 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |||
@@ -550,7 +550,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
550 | /// </summary> | 550 | /// </summary> |
551 | private void RecordMaterialAssetUuids(AssetBase materialAsset) | 551 | private void RecordMaterialAssetUuids(AssetBase materialAsset) |
552 | { | 552 | { |
553 | OSDMap mat = (OSDMap)OSDParser.DeserializeLLSDXml(materialAsset.Data); | 553 | OSDMap mat; |
554 | try | ||
555 | { | ||
556 | mat = (OSDMap)OSDParser.DeserializeLLSDXml(materialAsset.Data); | ||
557 | } | ||
558 | catch (Exception e) | ||
559 | { | ||
560 | m_log.WarnFormat("[Materials]: cannot decode material asset {0}: {1}", materialAsset.ID, e.Message); | ||
561 | return; | ||
562 | } | ||
554 | 563 | ||
555 | UUID normMap = mat["NormMap"].AsUUID(); | 564 | UUID normMap = mat["NormMap"].AsUUID(); |
556 | if (normMap != UUID.Zero) | 565 | if (normMap != UUID.Zero) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 6a39bb9..eb6455a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
51 | 51 | ||
52 | private static Thread cmdHandlerThread; | 52 | private static Thread cmdHandlerThread; |
53 | private static int cmdHandlerThreadCycleSleepms; | 53 | private static int cmdHandlerThreadCycleSleepms; |
54 | 54 | private static int numInstances; | |
55 | /// <summary> | 55 | /// <summary> |
56 | /// Lock for reading/writing static components of AsyncCommandManager. | 56 | /// Lock for reading/writing static components of AsyncCommandManager. |
57 | /// </summary> | 57 | /// </summary> |
@@ -172,18 +172,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
172 | if (!m_XmlRequest.ContainsKey(m_ScriptEngine)) | 172 | if (!m_XmlRequest.ContainsKey(m_ScriptEngine)) |
173 | m_XmlRequest[m_ScriptEngine] = new XmlRequest(this); | 173 | m_XmlRequest[m_ScriptEngine] = new XmlRequest(this); |
174 | 174 | ||
175 | StartThread(); | 175 | numInstances++; |
176 | } | 176 | if (cmdHandlerThread == null) |
177 | } | 177 | { |
178 | 178 | cmdHandlerThread = WorkManager.StartThread( | |
179 | private static void StartThread() | ||
180 | { | ||
181 | if (cmdHandlerThread == null) | ||
182 | { | ||
183 | // Start the thread that will be doing the work | ||
184 | cmdHandlerThread | ||
185 | = WorkManager.StartThread( | ||
186 | CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true, true); | 179 | CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true, true); |
180 | } | ||
187 | } | 181 | } |
188 | } | 182 | } |
189 | 183 | ||
@@ -197,20 +191,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
197 | ~AsyncCommandManager() | 191 | ~AsyncCommandManager() |
198 | { | 192 | { |
199 | // Shut down thread | 193 | // Shut down thread |
200 | // try | 194 | try |
201 | // { | 195 | { |
202 | // if (cmdHandlerThread != null) | 196 | lock (staticLock) |
203 | // { | 197 | { |
204 | // if (cmdHandlerThread.IsAlive == true) | 198 | numInstances--; |
205 | // { | 199 | if(numInstances > 0) |
206 | // cmdHandlerThread.Abort(); | 200 | return; |
207 | // //cmdHandlerThread.Join(); | 201 | if (cmdHandlerThread != null) |
208 | // } | 202 | { |
209 | // } | 203 | if (cmdHandlerThread.IsAlive == true) |
210 | // } | 204 | { |
211 | // catch | 205 | cmdHandlerThread.Abort(); |
212 | // { | 206 | //cmdHandlerThread.Join(); |
213 | // } | 207 | cmdHandlerThread = null; |
208 | } | ||
209 | } | ||
210 | } | ||
211 | } | ||
212 | catch | ||
213 | { | ||
214 | } | ||
214 | } | 215 | } |
215 | 216 | ||
216 | /// <summary> | 217 | /// <summary> |
@@ -240,24 +241,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
240 | lock (staticLock) | 241 | lock (staticLock) |
241 | { | 242 | { |
242 | // Check HttpRequests | 243 | // Check HttpRequests |
243 | m_HttpRequest[m_ScriptEngines[0]].CheckHttpRequests(); | 244 | try { m_HttpRequest[m_ScriptEngines[0]].CheckHttpRequests(); } catch {} |
244 | 245 | ||
245 | // Check XMLRPCRequests | 246 | // Check XMLRPCRequests |
246 | m_XmlRequest[m_ScriptEngines[0]].CheckXMLRPCRequests(); | 247 | try { m_XmlRequest[m_ScriptEngines[0]].CheckXMLRPCRequests(); } catch {} |
247 | 248 | ||
248 | foreach (IScriptEngine s in m_ScriptEngines) | 249 | foreach (IScriptEngine s in m_ScriptEngines) |
249 | { | 250 | { |
250 | // Check Listeners | 251 | // Check Listeners |
251 | m_Listener[s].CheckListeners(); | 252 | try { m_Listener[s].CheckListeners(); } catch {} |
253 | |||
252 | 254 | ||
253 | // Check timers | 255 | // Check timers |
254 | m_Timer[s].CheckTimerEvents(); | 256 | try { m_Timer[s].CheckTimerEvents(); } catch {} |
255 | 257 | ||
256 | // Check Sensors | 258 | // Check Sensors |
257 | m_SensorRepeat[s].CheckSenseRepeaterEvents(); | 259 | try { m_SensorRepeat[s].CheckSenseRepeaterEvents(); } catch {} |
258 | 260 | ||
259 | // Check dataserver | 261 | // Check dataserver |
260 | m_Dataserver[s].ExpireRequests(); | 262 | try { m_Dataserver[s].ExpireRequests(); } catch {} |
261 | } | 263 | } |
262 | } | 264 | } |
263 | } | 265 | } |
@@ -387,8 +389,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
387 | } | 389 | } |
388 | } | 390 | } |
389 | 391 | ||
390 | |||
391 | |||
392 | public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID) | 392 | public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID) |
393 | { | 393 | { |
394 | List<Object> data = new List<Object>(); | 394 | List<Object> data = new List<Object>(); |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 0ccc683..2e39033 100755 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -827,6 +827,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
827 | if (m_ScriptEngines.Contains(this)) | 827 | if (m_ScriptEngines.Contains(this)) |
828 | m_ScriptEngines.Remove(this); | 828 | m_ScriptEngines.Remove(this); |
829 | } | 829 | } |
830 | |||
831 | lock(m_Scripts) | ||
832 | m_ThreadPool.Shutdown(); | ||
830 | } | 833 | } |
831 | 834 | ||
832 | public object DoBackup(object o) | 835 | public object DoBackup(object o) |
diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs index 072429a..4e7ab00 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs | |||
@@ -64,7 +64,7 @@ namespace OpenSim.Server.Handlers.Login | |||
64 | public XmlRpcResponse HandleXMLRPCLogin(XmlRpcRequest request, IPEndPoint remoteClient) | 64 | public XmlRpcResponse HandleXMLRPCLogin(XmlRpcRequest request, IPEndPoint remoteClient) |
65 | { | 65 | { |
66 | Hashtable requestData = (Hashtable)request.Params[0]; | 66 | Hashtable requestData = (Hashtable)request.Params[0]; |
67 | if (m_Proxy && request.Params[3] != null) | 67 | if (request.Params[3] != null) |
68 | { | 68 | { |
69 | IPEndPoint ep = Util.GetClientIPFromXFF((string)request.Params[3]); | 69 | IPEndPoint ep = Util.GetClientIPFromXFF((string)request.Params[3]); |
70 | if (ep != null) | 70 | if (ep != null) |
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs index bfd73a2..331dabf 100644 --- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs | |||
@@ -225,8 +225,8 @@ namespace OpenSim.Server.Handlers.MapImage | |||
225 | 225 | ||
226 | private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) | 226 | private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) |
227 | { | 227 | { |
228 | if (!m_Proxy) | 228 | // if (!m_Proxy) |
229 | return request.RemoteIPEndPoint.Address; | 229 | // return request.RemoteIPEndPoint.Address; |
230 | 230 | ||
231 | // We're behind a proxy | 231 | // We're behind a proxy |
232 | string xff = "X-Forwarded-For"; | 232 | string xff = "X-Forwarded-For"; |
@@ -236,7 +236,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
236 | 236 | ||
237 | if (xffValue == null || (xffValue != null && xffValue == string.Empty)) | 237 | if (xffValue == null || (xffValue != null && xffValue == string.Empty)) |
238 | { | 238 | { |
239 | m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); | 239 | // m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); |
240 | return request.RemoteIPEndPoint.Address; | 240 | return request.RemoteIPEndPoint.Address; |
241 | } | 241 | } |
242 | 242 | ||
diff --git a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs index 8a3875d..9daeb73 100644 --- a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs | |||
@@ -229,8 +229,8 @@ namespace OpenSim.Server.Handlers.MapImage | |||
229 | 229 | ||
230 | private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) | 230 | private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) |
231 | { | 231 | { |
232 | if (!m_Proxy) | 232 | // if (!m_Proxy) |
233 | return request.RemoteIPEndPoint.Address; | 233 | // return request.RemoteIPEndPoint.Address; |
234 | 234 | ||
235 | // We're behind a proxy | 235 | // We're behind a proxy |
236 | string xff = "X-Forwarded-For"; | 236 | string xff = "X-Forwarded-For"; |
@@ -240,7 +240,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
240 | 240 | ||
241 | if (xffValue == null || (xffValue != null && xffValue == string.Empty)) | 241 | if (xffValue == null || (xffValue != null && xffValue == string.Empty)) |
242 | { | 242 | { |
243 | m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); | 243 | // m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); |
244 | return request.RemoteIPEndPoint.Address; | 244 | return request.RemoteIPEndPoint.Address; |
245 | } | 245 | } |
246 | 246 | ||
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 4e1f72e..c52a1ab 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -517,32 +517,30 @@ namespace OpenSim.Server.Handlers.Simulation | |||
517 | 517 | ||
518 | protected string GetCallerIP(Hashtable request) | 518 | protected string GetCallerIP(Hashtable request) |
519 | { | 519 | { |
520 | if (!m_Proxy) | 520 | if (request.ContainsKey("headers")) |
521 | return Util.GetCallerIP(request); | 521 | { |
522 | 522 | Hashtable headers = (Hashtable)request["headers"]; | |
523 | // We're behind a proxy | ||
524 | Hashtable headers = (Hashtable)request["headers"]; | ||
525 | |||
526 | //// DEBUG | ||
527 | //foreach (object o in headers.Keys) | ||
528 | // m_log.DebugFormat("XXX {0} = {1}", o.ToString(), (headers[o] == null? "null" : headers[o].ToString())); | ||
529 | 523 | ||
530 | string xff = "X-Forwarded-For"; | 524 | //// DEBUG |
531 | if (headers.ContainsKey(xff.ToLower())) | 525 | //foreach (object o in headers.Keys) |
532 | xff = xff.ToLower(); | 526 | // m_log.DebugFormat("XXX {0} = {1}", o.ToString(), (headers[o] == null? "null" : headers[o].ToString())); |
533 | 527 | ||
534 | if (!headers.ContainsKey(xff) || headers[xff] == null) | 528 | string xff = "X-Forwarded-For"; |
535 | { | 529 | if (!headers.ContainsKey(xff)) |
536 | m_log.WarnFormat("[AGENT HANDLER]: No XFF header"); | 530 | xff = xff.ToLower(); |
537 | return Util.GetCallerIP(request); | ||
538 | } | ||
539 | 531 | ||
540 | m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]); | 532 | if (!headers.ContainsKey(xff) || headers[xff] == null) |
533 | { | ||
534 | // m_log.WarnFormat("[AGENT HANDLER]: No XFF header"); | ||
535 | return Util.GetCallerIP(request); | ||
536 | } | ||
541 | 537 | ||
542 | IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]); | 538 | // m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]); |
543 | if (ep != null) | ||
544 | return ep.Address.ToString(); | ||
545 | 539 | ||
540 | IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]); | ||
541 | if (ep != null) | ||
542 | return ep.Address.ToString(); | ||
543 | } | ||
546 | // Oops | 544 | // Oops |
547 | return Util.GetCallerIP(request); | 545 | return Util.GetCallerIP(request); |
548 | } | 546 | } |
diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs index 5e7e14f..a331b39 100644 --- a/OpenSim/Server/ServerMain.cs +++ b/OpenSim/Server/ServerMain.cs | |||
@@ -81,6 +81,9 @@ namespace OpenSim.Server | |||
81 | ServicePointManager.UseNagleAlgorithm = false; | 81 | ServicePointManager.UseNagleAlgorithm = false; |
82 | ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate; | 82 | ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate; |
83 | 83 | ||
84 | try { ServicePointManager.DnsRefreshTimeout = 120000; } // just is case some mono decides to have it infinity | ||
85 | catch { } | ||
86 | |||
84 | m_Server = new HttpServerBase("R.O.B.U.S.T.", args); | 87 | m_Server = new HttpServerBase("R.O.B.U.S.T.", args); |
85 | 88 | ||
86 | string registryLocation; | 89 | string registryLocation; |