From 7e2b35bbb3be3a82be7bbb2b50099752f0196973 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 9 May 2011 11:35:41 -0700 Subject: Fixes gray tiles around +/-4 when user clicks on an empty tile. Affects regions above 4096 primarily. --- OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs | 2 +- OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs index a0ccdc7..8201031 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs @@ -76,7 +76,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid FillInMap(mapBlocks, minX, minY, maxX, maxY); // - remoteClient.SendMapBlock(mapBlocks, flag); + remoteClient.SendMapBlock(mapBlocks, 0); } diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 8073f2d..0e1dd19 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -846,7 +846,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap MapBlockFromGridRegion(block, r); mapBlocks.Add(block); } - remoteClient.SendMapBlock(mapBlocks, flag); + remoteClient.SendMapBlock(mapBlocks, 0); } protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r) -- cgit v1.1 From e1a4a8d8575926bbd3a201c4002e04880251c8b8 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 9 May 2011 18:28:16 -0700 Subject: Changed the Access flag on HGMap to 255 (does not exist) and clarified the other value 254 too. Meanings taken from libomv. --- OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs | 2 +- OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs index 8201031..d8681b5 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs @@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid mblock.X = (ushort)x; mblock.Y = (ushort)y; mblock.Name = ""; - mblock.Access = 254; // not here??? + mblock.Access = 255; // means 'simulator does not exist' mblock.MapImageId = UUID.Zero; mapBlocks.Add(mblock); } diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 0e1dd19..0cacf2d 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -820,7 +820,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap MapBlockData block = new MapBlockData(); block.X = (ushort)minX; block.Y = (ushort)minY; - block.Access = 254; // == not there + block.Access = 254; // means 'simulator is offline' response.Add(block); } remoteClient.SendMapBlock(response, 0); -- cgit v1.1 From 47735468d2e236a919e4f12d3cdbb8fd903149cb Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 10 May 2011 09:02:25 -0700 Subject: Somewhat reverting the last commit. The viewer ignores 255's on tiles that were previously on, so we need to send 254 (offline) explicitly. Also removing the +/-4 for HGMap, because it makes the map flicker. --- OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs index d8681b5..5ab334f 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs @@ -62,8 +62,8 @@ namespace OpenSim.Region.CoreModules.Hypergrid { List mapBlocks = new List(); List regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, - (minX - 4) * (int)Constants.RegionSize, (maxX + 4) * (int)Constants.RegionSize, - (minY - 4) * (int)Constants.RegionSize, (maxY + 4) * (int)Constants.RegionSize); + minX * (int)Constants.RegionSize, maxX * (int)Constants.RegionSize, + minY * (int)Constants.RegionSize, maxY * (int)Constants.RegionSize); foreach (GridRegion r in regions) { @@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid mblock.X = (ushort)x; mblock.Y = (ushort)y; mblock.Name = ""; - mblock.Access = 255; // means 'simulator does not exist' + mblock.Access = 254; // means 'simulator is offline'. We need this because the viewer ignores 255's mblock.MapImageId = UUID.Zero; mapBlocks.Add(mblock); } -- cgit v1.1 From 5548f837501184d68c352097ad1a1de566e18ca0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 11 May 2011 10:21:42 -0700 Subject: Functional improvement: close the stream. Non-functional: add debug messages to find out why updates are getting an error. WARNING: MASSIVE CONSOLE SPAM ON TPs. --- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 379924f..f938e4b 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -461,15 +461,32 @@ namespace OpenSim.Server.Handlers.Simulation Stream inputStream; if (httpRequest.ContentType == "application/x-gzip") + { + m_log.DebugFormat("[XXX]: Update called with application/x-gzip"); inputStream = new GZipStream(request, CompressionMode.Decompress); + } else inputStream = request; Encoding encoding = Encoding.UTF8; StreamReader reader = new StreamReader(inputStream, encoding); - string requestBody = reader.ReadToEnd(); - keysvals.Add("body", requestBody); + try + { + string requestBody = reader.ReadToEnd(); + m_log.DebugFormat("[XXX] body {0}", requestBody); + keysvals.Add("body", requestBody); + } + catch (Exception e) + { + m_log.DebugFormat("[AGENT HANDLER]: Exception readin gzip stream: {0}", e); + httpResponse.StatusCode = (int)HttpStatusCode.BadRequest; + return new byte[0]; + } + finally + { + reader.Close(); + } httpResponse.StatusCode = 200; httpResponse.ContentType = "text/html"; -- cgit v1.1 From af2e12d2b4fda54ec028c030c1fe5a87d1950251 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 11 May 2011 10:43:50 -0700 Subject: One more debug message. Don't use this unless your name is nebadon. --- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index f938e4b..46b511d 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -466,7 +466,10 @@ namespace OpenSim.Server.Handlers.Simulation inputStream = new GZipStream(request, CompressionMode.Decompress); } else + { + m_log.DebugFormat("[XXX]: Update called with {0}", httpRequest.ContentType); inputStream = request; + } Encoding encoding = Encoding.UTF8; StreamReader reader = new StreamReader(inputStream, encoding); -- cgit v1.1 From 7fa2489a6e2391205b17cde24cdb4cab1accc8bd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 11 May 2011 13:15:27 -0700 Subject: Revert "Functional improvement: close the stream. Non-functional: add debug messages to find out why updates are getting an error. WARNING: MASSIVE CONSOLE SPAM ON TPs." This reverts commit 5548f837501184d68c352097ad1a1de566e18ca0. --- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 46b511d..ad74b9b 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -461,10 +461,7 @@ namespace OpenSim.Server.Handlers.Simulation Stream inputStream; if (httpRequest.ContentType == "application/x-gzip") - { - m_log.DebugFormat("[XXX]: Update called with application/x-gzip"); inputStream = new GZipStream(request, CompressionMode.Decompress); - } else { m_log.DebugFormat("[XXX]: Update called with {0}", httpRequest.ContentType); @@ -474,22 +471,8 @@ namespace OpenSim.Server.Handlers.Simulation Encoding encoding = Encoding.UTF8; StreamReader reader = new StreamReader(inputStream, encoding); - try - { - string requestBody = reader.ReadToEnd(); - m_log.DebugFormat("[XXX] body {0}", requestBody); - keysvals.Add("body", requestBody); - } - catch (Exception e) - { - m_log.DebugFormat("[AGENT HANDLER]: Exception readin gzip stream: {0}", e); - httpResponse.StatusCode = (int)HttpStatusCode.BadRequest; - return new byte[0]; - } - finally - { - reader.Close(); - } + string requestBody = reader.ReadToEnd(); + keysvals.Add("body", requestBody); httpResponse.StatusCode = 200; httpResponse.ContentType = "text/html"; -- cgit v1.1 From ac12ace6f1f837cfe934ddc69438796ad174c84f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 12 May 2011 02:46:13 +0100 Subject: Prevent viewer 2 from creating a duplicate outfit inventory links. I believe this is safe since there is a 1-1 correspondence between link item and worn item (i.e. you can't be wearing the same item at two spots simultaneously in one outfit). This should stop lots of duplicate links being created when viewer 2 is used. However, this doesn't prevent broken inventory links, which I believe is timing related since the effect is not consistent (e.g. keep relogging and the viewer should end up seeing them correctly) . I think we actually see this problem on viewer 1 as well. It might be easier just to implement the Fetch*2 inventory caps which are documented at http://wiki.secondlife.com/wiki/Inventory_API. WebFetch* has been deprecated by Linden Lab since viewer 2.5.1 and according to the sl wiki, "has numerous bugs". --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index cd01a05..523b7f5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -904,11 +904,25 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Link an inventory item to an existing item. + /// + /// + /// + /// + /// + /// + /// + /// + /// /param> + /// private void HandleLinkInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, UUID olditemID) { - m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item link {0} in folder {1} pointing to {2}", name, folderID, olditemID); + m_log.DebugFormat( + "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}", + remoteClient.Name, name, folderID, olditemID); if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) return; @@ -916,7 +930,20 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence presence; if (TryGetScenePresence(remoteClient.AgentId, out presence)) { -// byte[] data = null; + bool linkAlreadyExists = false; + List existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID); + foreach (InventoryItemBase item in existingItems) + if (item.AssetID == olditemID) + linkAlreadyExists = true; + + if (linkAlreadyExists) + { + m_log.WarnFormat( + "[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link already exists", + remoteClient.Name, name, folderID, olditemID); + + return; + } AssetBase asset = new AssetBase(); asset.FullID = olditemID; -- cgit v1.1 From 9988bff9e3074f470ac57cd052674bcf816d7d8f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 12 May 2011 03:18:53 +0100 Subject: Add a smidgen of method doc about the fact that item links reuse the asset id item slot --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 523b7f5..a65ceeb 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -907,6 +907,10 @@ namespace OpenSim.Region.Framework.Scenes /// /// Link an inventory item to an existing item. /// + /// + /// The linkee item id is placed in the asset id slot. This appears to be what the viewer expects when + /// it receives inventory information. + /// /// /// /// -- cgit v1.1 From e9e4c009b470056dce05cae386860494b0734678 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 11 May 2011 20:44:03 -0700 Subject: This makes compression of fatpacks actually work. Previously they always failed. See comment in WebUtil. --- OpenSim/Framework/WebUtil.cs | 14 +++++++------- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 5 ++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 55b38cd..bc2cd01 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -199,14 +199,14 @@ namespace OpenSim.Framework using (GZipStream comp = new GZipStream(ms, CompressionMode.Compress)) { comp.Write(buffer, 0, buffer.Length); - comp.Flush(); - - ms.Seek(0, SeekOrigin.Begin); - - request.ContentLength = ms.Length; //Count bytes to send - using (Stream requestStream = request.GetRequestStream()) - requestStream.Write(ms.ToArray(), 0, (int)ms.Length); + // We need to close the gzip stream before we write it anywhere + // because apparently something important related to gzip compression + // gets written on the strteam upon Dispose() } + byte[] buf = ms.ToArray(); + request.ContentLength = buf.Length; //Count bytes to send + using (Stream requestStream = request.GetRequestStream()) + requestStream.Write(buf, 0, (int)buf.Length); } } else diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index ad74b9b..e8ae05b 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -283,6 +283,7 @@ namespace OpenSim.Server.Handlers.Simulation StreamReader reader = new StreamReader(inputStream, encoding); string requestBody = reader.ReadToEnd(); + reader.Close(); keysvals.Add("body", requestBody); httpResponse.StatusCode = 200; @@ -463,15 +464,13 @@ namespace OpenSim.Server.Handlers.Simulation if (httpRequest.ContentType == "application/x-gzip") inputStream = new GZipStream(request, CompressionMode.Decompress); else - { - m_log.DebugFormat("[XXX]: Update called with {0}", httpRequest.ContentType); inputStream = request; - } Encoding encoding = Encoding.UTF8; StreamReader reader = new StreamReader(inputStream, encoding); string requestBody = reader.ReadToEnd(); + reader.Close(); keysvals.Add("body", requestBody); httpResponse.StatusCode = 200; -- cgit v1.1 From f54a36bd592fec6571ddfda81d12a546583ab123 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 12 May 2011 17:34:26 -0700 Subject: Tracking a problem with offline IMs coming in as null list. --- OpenSim/Framework/WebUtil.cs | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index bc2cd01..2fd31d8 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -918,6 +918,10 @@ namespace OpenSim.Framework public class SynchronousRestObjectRequester { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + /// /// Perform a synchronous REST request. /// @@ -972,9 +976,9 @@ namespace OpenSim.Framework } } - try + using (WebResponse resp = request.GetResponse()) { - using (WebResponse resp = request.GetResponse()) + try { if (resp.ContentLength > 0) { @@ -984,10 +988,19 @@ namespace OpenSim.Framework respStream.Close(); } } - } - catch (System.InvalidOperationException) - { - // This is what happens when there is invalid XML + catch (System.InvalidOperationException) + { + // This is what happens when there is invalid XML + try + { + m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML:"); + using (StreamReader sr = new StreamReader(resp.GetResponseStream())) + m_log.WarnFormat("{0}", sr.ReadToEnd()); + } + catch (Exception e) + { } + + } } return deserial; } -- cgit v1.1 From 42bfab84b8a8197589bc60167a0f989492a37e17 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 12 May 2011 18:47:14 -0700 Subject: Bummer, can't print the data I wanted to see. Printing just the context. --- OpenSim/Framework/WebUtil.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 2fd31d8..0b99e82 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -991,15 +991,7 @@ namespace OpenSim.Framework catch (System.InvalidOperationException) { // This is what happens when there is invalid XML - try - { - m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML:"); - using (StreamReader sr = new StreamReader(resp.GetResponseStream())) - m_log.WarnFormat("{0}", sr.ReadToEnd()); - } - catch (Exception e) - { } - + m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString()); } } return deserial; -- cgit v1.1 From 9e310a0c0f9cbe06663fcd28fbd0ade3cb119d3d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 12 May 2011 18:53:22 -0700 Subject: Sequencing the using and try clauses as they were before, but this shows that that obsolete function is not catching 404's as it should... --- OpenSim/Framework/WebUtil.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 0b99e82..e9a1e03 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -976,9 +976,9 @@ namespace OpenSim.Framework } } - using (WebResponse resp = request.GetResponse()) + try { - try + using (WebResponse resp = request.GetResponse()) { if (resp.ContentLength > 0) { @@ -988,11 +988,11 @@ namespace OpenSim.Framework respStream.Close(); } } - catch (System.InvalidOperationException) - { - // This is what happens when there is invalid XML - m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString()); - } + } + catch (System.InvalidOperationException) + { + // This is what happens when there is invalid XML + m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString()); } return deserial; } -- cgit v1.1 From 691283c44eed8343b0aae2bde9d21bd86e9c506a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 12 May 2011 19:10:44 -0700 Subject: One more debug message for offline IMs. --- OpenSim/Framework/WebUtil.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index e9a1e03..cd93f71 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -965,8 +965,9 @@ namespace OpenSim.Framework requestStream = request.GetRequestStream(); requestStream.Write(buffer.ToArray(), 0, length); } - catch (Exception) + catch (Exception e) { + m_log.WarnFormat("[SynchronousRestObjectRequester]: exception in sending data to {0}: {1}", requestUrl, e); return deserial; } finally -- cgit v1.1 From 5f9edd195c702fac57ab76bca1c0357bce224868 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 May 2011 03:24:19 +0100 Subject: Fix broken inventory links on viewer 2. It appears that if the viewer requests a folder containing links, we must also send the folders that contain the link targets first. This was tested with Kokua 0.1.0 WIP though I predict it will also work with other viewer 2s --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 7 ++++++- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 21 +++++++++++++++++++-- .../Region/Framework/Scenes/Scene.PacketHandlers.cs | 4 ++++ bin/OpenSim.exe.config | 2 +- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 1da9d5e..5a2c45c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -1612,14 +1612,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP currentPacket.ItemData[itemsSent % MAX_ITEMS_PER_PACKET] = CreateItemDataBlock(items[itemsSent++]); else { +// m_log.DebugFormat( +// "[LLCLIENTVIEW]: Sending inventory folder details packet to {0} for folder {1}", Name, folderID); OutPacket(currentPacket, ThrottleOutPacketType.Asset, false); currentPacket = null; } - } if (currentPacket != null) + { +// m_log.DebugFormat( +// "[LLCLIENTVIEW]: Sending inventory folder details packet to {0} for folder {1}", Name, folderID); OutPacket(currentPacket, ThrottleOutPacketType.Asset, false); + } } private InventoryDescendentsPacket.FolderDataBlock CreateFolderDataBlock(InventoryFolderBase folder) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index a65ceeb..3bf2c2b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1382,11 +1382,28 @@ namespace OpenSim.Region.Framework.Scenes InventoryFolderBase containingFolder = new InventoryFolderBase(folder.ID, client.AgentId); containingFolder = InventoryService.GetFolder(containingFolder); - //m_log.DebugFormat("[AGENT INVENTORY]: Sending inventory folder contents ({0} nodes) for \"{1}\" to {2} {3}", - // contents.Folders.Count + contents.Items.Count, containingFolder.Name, client.FirstName, client.LastName); +// m_log.DebugFormat("[AGENT INVENTORY]: Sending inventory folder contents ({0} nodes) for \"{1}\" to {2} {3}", +// contents.Folders.Count + contents.Items.Count, containingFolder.Name, client.FirstName, client.LastName); if (containingFolder != null && containingFolder != null) + { + // If the folder requested contains links, then we need to send those folders first, otherwise the links + // will be broken in the viewer. + HashSet linkedItemFolderIdsToSend = new HashSet(); + foreach (InventoryItemBase item in contents.Items) + { + if (item.AssetType == (int)AssetType.Link) + { + InventoryItemBase linkedItem = InventoryService.GetItem(new InventoryItemBase(item.AssetID)); + linkedItemFolderIdsToSend.Add(linkedItem.Folder); + } + } + + foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend) + SendInventoryUpdate(client, new InventoryFolderBase(linkedItemFolderId), false, true); + client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, containingFolder.Version, fetchFolders, fetchItems); + } } /// diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index ab567fb..e2d7208 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -499,6 +499,10 @@ namespace OpenSim.Region.Framework.Scenes public void HandleFetchInventoryDescendents(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) { +// m_log.DebugFormat( +// "[USER INVENTORY]: HandleFetchInventoryDescendents() for {0}, folder={1}, fetchFolders={2}, fetchItems={3}, sortOrder={4}", +// remoteClient.Name, folderID, fetchFolders, fetchItems, sortOrder); + if (folderID == UUID.Zero) return; diff --git a/bin/OpenSim.exe.config b/bin/OpenSim.exe.config index eece040..4a49fc5 100755 --- a/bin/OpenSim.exe.config +++ b/bin/OpenSim.exe.config @@ -14,7 +14,7 @@ - + -- cgit v1.1 From 301321c8535d702651eb8287bc2312df13562683 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 12 May 2011 19:56:59 -0700 Subject: Instrument the heck out of offline messages. THIS IS VERY VERBOSE. --- OpenSim/Framework/WebUtil.cs | 16 ++++++++++++++++ .../Avatar/InstantMessage/OfflineMessageModule.cs | 3 +++ 2 files changed, 19 insertions(+) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index cd93f71..511d660 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -940,6 +940,8 @@ namespace OpenSim.Framework WebRequest request = WebRequest.Create(requestUrl); request.Method = verb; + m_log.DebugFormat("[XXX] 1"); + if ((verb == "POST") || (verb == "PUT")) { request.ContentType = "text/xml"; @@ -959,11 +961,14 @@ namespace OpenSim.Framework int length = (int)buffer.Length; request.ContentLength = length; + m_log.DebugFormat("[XXX] 2"); Stream requestStream = null; try { requestStream = request.GetRequestStream(); requestStream.Write(buffer.ToArray(), 0, length); + m_log.DebugFormat("[XXX] Wrote to stream ok"); + } catch (Exception e) { @@ -977,6 +982,8 @@ namespace OpenSim.Framework } } + m_log.DebugFormat("[XXX] Getting response now... {0}", requestUrl); + try { using (WebResponse resp = request.GetResponse()) @@ -988,6 +995,9 @@ namespace OpenSim.Framework deserial = (TResponse)deserializer.Deserialize(respStream); respStream.Close(); } + else + m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb); + } } catch (System.InvalidOperationException) @@ -995,6 +1005,12 @@ namespace OpenSim.Framework // This is what happens when there is invalid XML m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString()); } + catch (Exception e) + { + m_log.WarnFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e); + } + + m_log.DebugFormat("[XXX] reply is null? {0}", (deserial == null) ? "yes": "no"); return deserial; } } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 919ea33..321b38b 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -178,6 +178,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage List msglist = SynchronousRestObjectPoster.BeginPostObject>( "POST", m_RestURL + "/RetrieveMessages/", client.AgentId); + if (msglist == null) + m_log.WarnFormat("[OFFLINE MESSAGING]: WARNING null message list."); + foreach (GridInstantMessage im in msglist) { // client.SendInstantMessage(im); -- cgit v1.1 From 1cc70df3b45f188f10c7c835bf89700d629203f0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 12 May 2011 20:20:08 -0700 Subject: One more thing printed out. #OfflineIM --- OpenSim/Framework/WebUtil.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 511d660..8fd34cf 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -940,8 +940,6 @@ namespace OpenSim.Framework WebRequest request = WebRequest.Create(requestUrl); request.Method = verb; - m_log.DebugFormat("[XXX] 1"); - if ((verb == "POST") || (verb == "PUT")) { request.ContentType = "text/xml"; @@ -961,7 +959,6 @@ namespace OpenSim.Framework int length = (int)buffer.Length; request.ContentLength = length; - m_log.DebugFormat("[XXX] 2"); Stream requestStream = null; try { @@ -996,7 +993,7 @@ namespace OpenSim.Framework respStream.Close(); } else - m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb); + m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}, ContentLength = {2}", requestUrl, verb, resp.ContentLength); } } -- cgit v1.1 From e39dec6f371bc9c0fbb92e010ee7fd8fbeef7d18 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 12 May 2011 20:48:24 -0700 Subject: Hopefully this fixes offline messages. The problem was: the server is not setting the ContentLength of the response. That comes up to OpenSim as ContentLength=-1, which made the existing test fail. --- OpenSim/Framework/WebUtil.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 8fd34cf..27a646a 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -964,8 +964,6 @@ namespace OpenSim.Framework { requestStream = request.GetRequestStream(); requestStream.Write(buffer.ToArray(), 0, length); - m_log.DebugFormat("[XXX] Wrote to stream ok"); - } catch (Exception e) { @@ -979,13 +977,11 @@ namespace OpenSim.Framework } } - m_log.DebugFormat("[XXX] Getting response now... {0}", requestUrl); - try { using (WebResponse resp = request.GetResponse()) { - if (resp.ContentLength > 0) + if (resp.ContentLength != 0) { Stream respStream = resp.GetResponseStream(); XmlSerializer deserializer = new XmlSerializer(typeof(TResponse)); @@ -993,7 +989,7 @@ namespace OpenSim.Framework respStream.Close(); } else - m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}, ContentLength = {2}", requestUrl, verb, resp.ContentLength); + m_log.WarnFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb); } } @@ -1007,7 +1003,6 @@ namespace OpenSim.Framework m_log.WarnFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e); } - m_log.DebugFormat("[XXX] reply is null? {0}", (deserial == null) ? "yes": "no"); return deserial; } } -- cgit v1.1