From 5e35651efc98fd140a454c2dd6c5e826573f9dd6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 17 Jan 2011 11:45:13 -0800 Subject: Protect World Map module, RequestMapItemsAsync, from badly formed URLs. --- OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index f9d28b9..e0f36a2 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -641,7 +641,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap lock (m_openRequests) m_openRequests.Add(requestID, mrs); - WebRequest mapitemsrequest = WebRequest.Create(httpserver); + WebRequest mapitemsrequest = null; + try + { + mapitemsrequest = WebRequest.Create(httpserver); + } + catch (Exception e) + { + m_log.DebugFormat("[WORLD MAP]: Access to {0} failed with {1}", httpserver, e); + return new OSDMap(); + } + mapitemsrequest.Method = "POST"; mapitemsrequest.ContentType = "application/xml+llsd"; OSDMap RAMap = new OSDMap(); -- cgit v1.1 From 59c2cd04ba056b85eb4873e472b95826a1cc13b5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 17 Jan 2011 12:35:19 -0800 Subject: DEBUG DEBUG DEBUG --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3a40196..8e4aaf1 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -839,6 +839,7 @@ namespace OpenSim.Region.Framework.Scenes m_rootRegionHandle = m_scene.RegionInfo.RegionHandle; m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); + m_log.DebugFormat("[XXX] MakeRoot 1"); // Moved this from SendInitialData to ensure that m_appearance is initialized // before the inventory is processed in MakeRootAgent. This fixes a race condition @@ -899,6 +900,7 @@ namespace OpenSim.Region.Framework.Scenes } AddToPhysicalScene(isFlying); + m_log.DebugFormat("[XXX] MakeRoot 2"); if (m_appearance != null) { @@ -941,7 +943,9 @@ namespace OpenSim.Region.Framework.Scenes presence.Animator.SendAnimPackToClient(ControllingClient); }); + m_log.DebugFormat("[XXX] MakeRoot 3"); m_scene.EventManager.TriggerOnMakeRootAgent(this); + m_log.DebugFormat("[XXX] MakeRoot 4"); } /// -- cgit v1.1 From 4bcee1dfb4337fca342fd29916d5da3b4c7db954 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 17 Jan 2011 13:07:02 -0800 Subject: Revert "DEBUG DEBUG DEBUG" This reverts commit 59c2cd04ba056b85eb4873e472b95826a1cc13b5. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 8e4aaf1..3a40196 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -839,7 +839,6 @@ namespace OpenSim.Region.Framework.Scenes m_rootRegionHandle = m_scene.RegionInfo.RegionHandle; m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); - m_log.DebugFormat("[XXX] MakeRoot 1"); // Moved this from SendInitialData to ensure that m_appearance is initialized // before the inventory is processed in MakeRootAgent. This fixes a race condition @@ -900,7 +899,6 @@ namespace OpenSim.Region.Framework.Scenes } AddToPhysicalScene(isFlying); - m_log.DebugFormat("[XXX] MakeRoot 2"); if (m_appearance != null) { @@ -943,9 +941,7 @@ namespace OpenSim.Region.Framework.Scenes presence.Animator.SendAnimPackToClient(ControllingClient); }); - m_log.DebugFormat("[XXX] MakeRoot 3"); m_scene.EventManager.TriggerOnMakeRootAgent(this); - m_log.DebugFormat("[XXX] MakeRoot 4"); } /// -- cgit v1.1 From aecaadd3bdb8013addde47731e12427e2acc8994 Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 17 Jan 2011 13:10:09 -0800 Subject: objectId in AvatarAnimation packet should be UUID.Zero for non-overridden animations --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index ee4f04e..c765e68 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3466,8 +3466,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP ani.AnimationSourceList[i] = new AvatarAnimationPacket.AnimationSourceListBlock(); ani.AnimationSourceList[i].ObjectID = objectIDs[i]; - if (objectIDs[i] == UUID.Zero) - ani.AnimationSourceList[i].ObjectID = sourceAgentId; } ani.Header.Reliable = false; OutPacket(ani, ThrottleOutPacketType.Task); -- cgit v1.1 From 81552099d6eaf1142cde4bbe864dfa1e752af5e5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 17 Jan 2011 23:45:25 +0000 Subject: Fix UnackedBytes client stack statistic as seen in "show queues" Bytes were being wrongly added again on a resend --- OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 2 -- OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index e54cfc2..fe5156e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -585,8 +585,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Stats tracking Interlocked.Increment(ref udpClient.PacketsSent); - if (isReliable) - Interlocked.Add(ref udpClient.UnackedBytes, outgoingPacket.Buffer.DataLength); // Put the UDP payload on the wire AsyncBeginSend(buffer); diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs index 4cb4aee..d762bef 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using System.Net; +using System.Threading; using OpenMetaverse; namespace OpenSim.Region.ClientStack.LindenUDP @@ -77,6 +78,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void Add(OutgoingPacket packet) { m_pendingAdds.Enqueue(packet); + Interlocked.Add(ref packet.Client.UnackedBytes, packet.Buffer.DataLength); } /// @@ -166,7 +168,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_packets.Remove(pendingRemove.SequenceNumber); // Update stats - System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); + Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); if (!pendingRemove.FromResend) { -- cgit v1.1 From 6e58996b4d9db202cd7795a37bd687362effef48 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 17 Jan 2011 23:57:50 +0000 Subject: refactor: remove redundant null checks --- .../LindenUDP/UnackedPacketCollection.cs | 45 ++++++++-------------- 1 file changed, 15 insertions(+), 30 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs index d762bef..9d40688 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs @@ -141,46 +141,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP private void ProcessQueues() { // Process all the pending adds - OutgoingPacket pendingAdd; - if (m_pendingAdds != null) - { - while (m_pendingAdds.TryDequeue(out pendingAdd)) - { - if (pendingAdd != null && m_packets != null) - { - m_packets[pendingAdd.SequenceNumber] = pendingAdd; - } - } - } + while (m_pendingAdds.TryDequeue(out pendingAdd)) + m_packets[pendingAdd.SequenceNumber] = pendingAdd; // Process all the pending removes, including updating statistics and round-trip times PendingAck pendingRemove; OutgoingPacket ackedPacket; - if (m_pendingRemoves != null) + while (m_pendingRemoves.TryDequeue(out pendingRemove)) { - while (m_pendingRemoves.TryDequeue(out pendingRemove)) + if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) { - if (m_pendingRemoves != null && m_packets != null) + m_packets.Remove(pendingRemove.SequenceNumber); + + // Update stats + Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); + + if (!pendingRemove.FromResend) { - if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) - { - m_packets.Remove(pendingRemove.SequenceNumber); - - // Update stats - Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); - - if (!pendingRemove.FromResend) - { - // Calculate the round-trip time for this packet and its ACK - int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount; - if (rtt > 0) - ackedPacket.Client.UpdateRoundTrip(rtt); - } - } + // Calculate the round-trip time for this packet and its ACK + int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount; + if (rtt > 0) + ackedPacket.Client.UpdateRoundTrip(rtt); } } } } } -} +} \ No newline at end of file -- cgit v1.1 From c544f0d0c5fcea625107c0eff25be8aa0586564a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 18 Jan 2011 00:25:24 +0000 Subject: Prune some of the excess logging for client logins. Didn't touch the appearance related stuff. --- OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 6 +++--- OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs | 2 +- OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 4 ++-- OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index fe5156e..571624b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -857,9 +857,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Acknowledge the UseCircuitCode packet SendAckImmediate(remoteEndPoint, packet.Header.Sequence); - m_log.DebugFormat( - "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", - buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); +// m_log.DebugFormat( +// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", +// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); } private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber) diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs index 36aaab3..8347e35 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs @@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets { UUID capID = UUID.Random(); - m_log.Info("[GETMESH]: /CAPS/" + capID); +// m_log.Info("[GETMESH]: /CAPS/" + capID); caps.RegisterHandler("GetMesh", new RestHTTPHandler("GET", "/CAPS/" + capID, delegate(Hashtable m_dhttpMethod) diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 1f60e36..6fb8b46 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps { UUID capID = UUID.Random(); - m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); +// m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); } @@ -171,7 +171,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps /// False for "caller try another codec"; true otherwise private bool FetchTexture(OSHttpRequest httpRequest, OSHttpResponse httpResponse, UUID textureID, string format) { - m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format); +// m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format); AssetBase texture; string fullID = textureID.ToString(); diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs index c011776..008233b 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps { UUID capuuid = UUID.Random(); - m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); +// m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); caps.RegisterHandler("ObjectAdd", new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/", diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3a40196..7b94202 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1161,9 +1161,9 @@ namespace OpenSim.Region.Framework.Scenes friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); } - m_log.DebugFormat( - "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", - client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); +// m_log.DebugFormat( +// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", +// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); } /// -- cgit v1.1 From 3083c517a01b4265434f9286aa1c95b2b513549b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 18 Jan 2011 00:29:10 +0000 Subject: minor: resolve some mono compiler warnings --- OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 004e20c..cff2cf4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -849,7 +849,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void RequestInventoryFile(IClientAPI client, IXfer xferManager) { - bool changed = CreateInventoryFile(); + CreateInventoryFile(); if (m_inventorySerial == 0) // No inventory { diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7b94202..03cd90f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1108,7 +1108,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void CompleteMovement(IClientAPI client) { - DateTime startTime = DateTime.Now; +// DateTime startTime = DateTime.Now; m_log.DebugFormat( "[SCENE PRESENCE]: Completing movement of {0} into region {1}", -- cgit v1.1 From 624bf23abb3f7cf58447c73cff5187963945a15a Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 17 Jan 2011 16:39:53 -0800 Subject: force objectId to UUID.Zero for non-overridden animations in AvatarAnimation packet --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index c765e68..e43e3c9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3465,7 +3465,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP ani.AnimationList[i].AnimSequenceID = seqs[i]; ani.AnimationSourceList[i] = new AvatarAnimationPacket.AnimationSourceListBlock(); - ani.AnimationSourceList[i].ObjectID = objectIDs[i]; + if (objectIDs[i].Equals(sourceAgentId)) + ani.AnimationSourceList[i].ObjectID = UUID.Zero; + else + ani.AnimationSourceList[i].ObjectID = objectIDs[i]; } ani.Header.Reliable = false; OutPacket(ani, ThrottleOutPacketType.Task); -- cgit v1.1 From c98d1cffe222085378ef8a9935f956882eae4ee9 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 17 Jan 2011 17:40:48 -0800 Subject: Removed the call to sceneViewer.Reset upon MakeRoot and ChildAgentUpdate, because Reset hangs for a long time waiting for the lock. That is a problem in itself -- that long holding of the lock by some thread -- but let's just avoid it altogether. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 -------- 1 file changed, 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3a40196..f811f3e 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -928,10 +928,6 @@ namespace OpenSim.Region.Framework.Scenes //else // m_log.ErrorFormat("[SCENE]: Could not find user info for {0} when making it a root agent", m_uuid); - // On the next prim update, all objects will be sent - // - m_sceneViewer.Reset(); - m_isChildAgent = false; // send the animations of the other presences to me @@ -2952,10 +2948,6 @@ namespace OpenSim.Region.Framework.Scenes if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); - // Sends out the objects in the user's draw distance if m_sendTasksToChild is true. - if (m_scene.m_seeIntoRegionFromNeighbor) - m_sceneViewer.Reset(); - //cAgentData.AVHeight; m_rootRegionHandle = cAgentData.RegionHandle; //m_velocity = cAgentData.Velocity; -- cgit v1.1