aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMelanie2009-08-29 03:26:44 +0100
committerMelanie2009-08-29 03:26:44 +0100
commit976cf4284bdbef14553c2e164cb67d25bd2b9076 (patch)
tree20004db93f70bc5116df39986d0da4119c7891e0 /OpenSim/Framework
parentModify CAPS inventory code. Currently this is not executed (diff)
downloadopensim-SC_OLD-976cf4284bdbef14553c2e164cb67d25bd2b9076.zip
opensim-SC_OLD-976cf4284bdbef14553c2e164cb67d25bd2b9076.tar.gz
opensim-SC_OLD-976cf4284bdbef14553c2e164cb67d25bd2b9076.tar.bz2
opensim-SC_OLD-976cf4284bdbef14553c2e164cb67d25bd2b9076.tar.xz
Fix up WebFetchInventoryDescendents to really return all data needed,
especially the folder version and the subfolders. Fixes inventory search hang and folders not loading.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs28
-rw-r--r--OpenSim/Framework/Servers/HttpServer/RestSessionService.cs2
2 files changed, 13 insertions, 17 deletions
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index 5ae33d6..c5560b8 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Framework.Capabilities
58 bool isScriptRunning, byte[] data); 58 bool isScriptRunning, byte[] data);
59 59
60 public delegate InventoryCollection FetchInventoryDescendentsCAPS(UUID agentID, UUID folderID, UUID ownerID, 60 public delegate InventoryCollection FetchInventoryDescendentsCAPS(UUID agentID, UUID folderID, UUID ownerID,
61 bool fetchFolders, bool fetchItems, int sortOrder); 61 bool fetchFolders, bool fetchItems, int sortOrder, out int version);
62 62
63 /// <summary> 63 /// <summary>
64 /// XXX Probably not a particularly nice way of allow us to get the scene presence from the scene (chiefly so that 64 /// XXX Probably not a particularly nice way of allow us to get the scene presence from the scene (chiefly so that
@@ -89,7 +89,7 @@ namespace OpenSim.Framework.Capabilities
89 //private static readonly string m_requestTexture = "0003/"; 89 //private static readonly string m_requestTexture = "0003/";
90 private static readonly string m_notecardUpdatePath = "0004/"; 90 private static readonly string m_notecardUpdatePath = "0004/";
91 private static readonly string m_notecardTaskUpdatePath = "0005/"; 91 private static readonly string m_notecardTaskUpdatePath = "0005/";
92 // private static readonly string m_fetchInventoryPath = "0006/"; 92 private static readonly string m_fetchInventoryPath = "0006/";
93 93
94 // The following entries are in a module, however, they are also here so that we don't re-assign 94 // The following entries are in a module, however, they are also here so that we don't re-assign
95 // the path to another cap by mistake. 95 // the path to another cap by mistake.
@@ -207,7 +207,7 @@ namespace OpenSim.Framework.Capabilities
207 // As of RC 1.22.9 of the Linden client this is 207 // As of RC 1.22.9 of the Linden client this is
208 // supported 208 // supported
209 209
210 // m_capsHandlers["WebFetchInventoryDescendents"] =new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryDescendentsRequest); 210 m_capsHandlers["WebFetchInventoryDescendents"] =new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryDescendentsRequest);
211 211
212 // justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and 212 // justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and
213 // subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires 213 // subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires
@@ -449,23 +449,14 @@ namespace OpenSim.Framework.Capabilities
449 contents.owner_id = invFetch.owner_id; 449 contents.owner_id = invFetch.owner_id;
450 contents.folder_id = invFetch.folder_id; 450 contents.folder_id = invFetch.folder_id;
451 451
452 // The version number being sent back was originally 1.
453 // Unfortunately, on 1.19.1.4, this means that we see a problem where on subsequent logins
454 // without clearing client cache, objects in the root folder disappear until the cache is cleared,
455 // at which point they reappear.
456 //
457 // Seeing the version to something other than 0 may be the right thing to do, but there is
458 // a greater subtlety of the second life protocol that needs to be understood first.
459 contents.version = 0;
460
461 contents.descendents = 0;
462 reply.folders.Array.Add(contents); 452 reply.folders.Array.Add(contents);
463 InventoryCollection inv = new InventoryCollection(); 453 InventoryCollection inv = new InventoryCollection();
464 inv.Folders = new List<InventoryFolderBase>(); 454 inv.Folders = new List<InventoryFolderBase>();
465 inv.Items = new List<InventoryItemBase>(); 455 inv.Items = new List<InventoryItemBase>();
456 int version = 0;
466 if (CAPSFetchInventoryDescendents != null) 457 if (CAPSFetchInventoryDescendents != null)
467 { 458 {
468 inv = CAPSFetchInventoryDescendents(m_agentID, invFetch.folder_id, invFetch.owner_id, invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order); 459 inv = CAPSFetchInventoryDescendents(m_agentID, invFetch.folder_id, invFetch.owner_id, invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order, out version);
469 } 460 }
470 461
471 if (inv.Folders != null) 462 if (inv.Folders != null)
@@ -484,7 +475,9 @@ namespace OpenSim.Framework.Capabilities
484 } 475 }
485 } 476 }
486 477
487 contents.descendents = contents.items.Array.Count; 478 contents.descendents = contents.items.Array.Count + contents.categories.Array.Count;
479 contents.version = version;
480
488 return reply; 481 return reply;
489 } 482 }
490 483
@@ -499,7 +492,10 @@ namespace OpenSim.Framework.Capabilities
499 llsdFolder.folder_id = invFolder.ID; 492 llsdFolder.folder_id = invFolder.ID;
500 llsdFolder.parent_id = invFolder.ParentID; 493 llsdFolder.parent_id = invFolder.ParentID;
501 llsdFolder.name = invFolder.Name; 494 llsdFolder.name = invFolder.Name;
502 llsdFolder.type = TaskInventoryItem.InvTypes[invFolder.Type]; 495 if (invFolder.Type == -1)
496 llsdFolder.type = "-1";
497 else
498 llsdFolder.type = TaskInventoryItem.Types[invFolder.Type];
503 llsdFolder.preferred_type = "-1"; 499 llsdFolder.preferred_type = "-1";
504 500
505 return llsdFolder; 501 return llsdFolder;
diff --git a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs
index 2ef4a36..3f72c31 100644
--- a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs
+++ b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs
@@ -94,6 +94,7 @@ namespace OpenSim.Framework.Servers.HttpServer
94 94
95 Stream requestStream = request.GetRequestStream(); 95 Stream requestStream = request.GetRequestStream();
96 requestStream.Write(buffer.ToArray(), 0, length); 96 requestStream.Write(buffer.ToArray(), 0, length);
97 requestStream.Close();
97 TResponse deserial = default(TResponse); 98 TResponse deserial = default(TResponse);
98 using (WebResponse resp = request.GetResponse()) 99 using (WebResponse resp = request.GetResponse())
99 { 100 {
@@ -101,7 +102,6 @@ namespace OpenSim.Framework.Servers.HttpServer
101 deserial = (TResponse)deserializer.Deserialize(resp.GetResponseStream()); 102 deserial = (TResponse)deserializer.Deserialize(resp.GetResponseStream());
102 resp.Close(); 103 resp.Close();
103 } 104 }
104 requestStream.Close();
105 return deserial; 105 return deserial;
106 } 106 }
107 } 107 }