diff --git a/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs
index 3d3340ff8a..451575f8ec 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventoryDescendents/FetchInvDescHandler.cs
@@ -92,6 +92,7 @@ namespace OpenSim.Capabilities.Handlers
ArrayList foldersrequested = (ArrayList)hash["folders"];
string response = "";
+ string bad_folders_response = "";
for (int i = 0; i < foldersrequested.Count; i++)
{
@@ -110,24 +111,42 @@ namespace OpenSim.Capabilities.Handlers
}
LLSDInventoryDescendents reply = FetchInventoryReply(llsdRequest);
- inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply);
- inventoryitemstr = inventoryitemstr.Replace("", "");
+ if (null == reply)
+ {
+ bad_folders_response += "" + llsdRequest.folder_id.ToString() + "";
+ }
+ else
+ {
+ inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply);
+ inventoryitemstr = inventoryitemstr.Replace("", "");
+ }
response += inventoryitemstr;
}
if (response.Length == 0)
{
- // Ter-guess: If requests fail a lot, the client seems to stop requesting descendants.
- // Therefore, I'm concluding that the client only has so many threads available to do requests
- // and when a thread stalls.. is stays stalled.
- // Therefore we need to return something valid
- response = "";
+ /* Viewers expect a bad_folders array when not available */
+ if (bad_folders_response.Length != 0)
+ {
+ response = "";
+ }
+ else
+ {
+ response = "";
+ }
}
else
{
- response = "";
+ if (bad_folders_response.Length != 0)
+ {
+ response = "";
+ }
+ else
+ {
+ response = "";
+ }
}
// m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Replying to CAPS fetch inventory request");