Made HandleFetchInventoryDescendents async, so that the client thread doesn't wait for the download of the entire inventory.

arthursv
Diva Canto 2009-08-20 22:36:47 -07:00
parent 9e64427262
commit e4f64dd714
2 changed files with 18 additions and 5 deletions

View File

@ -441,9 +441,24 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
} }
// We're going to send the reply async, because there may be
// an enormous quantity of packets -- basically the entire inventory!
// We don't want to block the client thread while all that is happening.
SendInventoryDelegate d = SendInventoryAsync;
d.BeginInvoke(remoteClient, folderID, ownerID, fetchFolders, fetchItems, sortOrder, SendInventoryComplete, d);
}
delegate void SendInventoryDelegate(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder);
void SendInventoryAsync(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
{
SendInventoryUpdate(remoteClient, new InventoryFolderBase(folderID), fetchFolders, fetchItems); SendInventoryUpdate(remoteClient, new InventoryFolderBase(folderID), fetchFolders, fetchItems);
} }
void SendInventoryComplete(IAsyncResult iar)
{
}
/// <summary> /// <summary>
/// Handle the caps inventory descendents fetch. /// Handle the caps inventory descendents fetch.
/// ///

View File

@ -235,8 +235,6 @@ namespace OpenSim.Services.InventoryService
public InventoryCollection GetFolderContent(UUID userID, UUID folderID) public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
{ {
m_log.Info("[INVENTORY SERVICE]: Processing request for folder " + folderID);
// Uncomment me to simulate a slow responding inventory server // Uncomment me to simulate a slow responding inventory server
//Thread.Sleep(16000); //Thread.Sleep(16000);
@ -249,7 +247,7 @@ namespace OpenSim.Services.InventoryService
invCollection.Folders = folders; invCollection.Folders = folders;
invCollection.Items = items; invCollection.Items = items;
m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders", items.Count, folders.Count); m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders in folder {2}", items.Count, folders.Count, folderID);
return invCollection; return invCollection;
} }