diff options
author | Diva Canto | 2009-08-20 22:36:47 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-20 22:36:47 -0700 |
commit | e4f64dd7147001e1e0ac9bd4a51efec086727b29 (patch) | |
tree | 9a025be0ebbdf7193774e197b44391a8086e6b39 /OpenSim | |
parent | Putting the inventory packets back to ThrottleOutPacketType.Asset, because th... (diff) | |
download | opensim-SC_OLD-e4f64dd7147001e1e0ac9bd4a51efec086727b29.zip opensim-SC_OLD-e4f64dd7147001e1e0ac9bd4a51efec086727b29.tar.gz opensim-SC_OLD-e4f64dd7147001e1e0ac9bd4a51efec086727b29.tar.bz2 opensim-SC_OLD-e4f64dd7147001e1e0ac9bd4a51efec086727b29.tar.xz |
Made HandleFetchInventoryDescendents async, so that the client thread doesn't wait for the download of the entire inventory.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 19 | ||||
-rw-r--r-- | OpenSim/Services/InventoryService/InventoryService.cs | 4 |
2 files changed, 18 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index d722e23..2b815a2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -441,9 +441,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
441 | return; | 441 | return; |
442 | } | 442 | } |
443 | 443 | ||
444 | // We're going to send the reply async, because there may be | ||
445 | // an enormous quantity of packets -- basically the entire inventory! | ||
446 | // We don't want to block the client thread while all that is happening. | ||
447 | SendInventoryDelegate d = SendInventoryAsync; | ||
448 | d.BeginInvoke(remoteClient, folderID, ownerID, fetchFolders, fetchItems, sortOrder, SendInventoryComplete, d); | ||
449 | } | ||
450 | |||
451 | delegate void SendInventoryDelegate(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder); | ||
452 | |||
453 | void SendInventoryAsync(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) | ||
454 | { | ||
444 | SendInventoryUpdate(remoteClient, new InventoryFolderBase(folderID), fetchFolders, fetchItems); | 455 | SendInventoryUpdate(remoteClient, new InventoryFolderBase(folderID), fetchFolders, fetchItems); |
445 | } | 456 | } |
446 | 457 | ||
458 | void SendInventoryComplete(IAsyncResult iar) | ||
459 | { | ||
460 | } | ||
461 | |||
447 | /// <summary> | 462 | /// <summary> |
448 | /// Handle the caps inventory descendents fetch. | 463 | /// Handle the caps inventory descendents fetch. |
449 | /// | 464 | /// |
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index 6310254..45bbd37 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs | |||
@@ -235,8 +235,6 @@ namespace OpenSim.Services.InventoryService | |||
235 | 235 | ||
236 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | 236 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) |
237 | { | 237 | { |
238 | m_log.Info("[INVENTORY SERVICE]: Processing request for folder " + folderID); | ||
239 | |||
240 | // Uncomment me to simulate a slow responding inventory server | 238 | // Uncomment me to simulate a slow responding inventory server |
241 | //Thread.Sleep(16000); | 239 | //Thread.Sleep(16000); |
242 | 240 | ||
@@ -249,7 +247,7 @@ namespace OpenSim.Services.InventoryService | |||
249 | invCollection.Folders = folders; | 247 | invCollection.Folders = folders; |
250 | invCollection.Items = items; | 248 | invCollection.Items = items; |
251 | 249 | ||
252 | m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders", items.Count, folders.Count); | 250 | m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders in folder {2}", items.Count, folders.Count, folderID); |
253 | 251 | ||
254 | return invCollection; | 252 | return invCollection; |
255 | } | 253 | } |