If a user with a very large inventory right-clicks on their "My Inventory" folder, viewer 1 code will send a massive number of Fetchinventory requests.
Even though each is handled asynchronously via a pool thread, the sheer frequency of requests overwhelms the pool and freezes inbound packet handling.
This change makes the first Fetchinventory thread also handle subsequent requests, freeing up the other threads.
Further efficiencies could be made by handling all the items in a particular FetchInventory request together, rather than separately.
this is a prerequisite to fixing llDialog issues for the latest Linden viewers, since they are now making use of a new OwnerData field in the ScriptDialog message
This is effectively a copy/paste from 459323a, which should be refactored sometime.
This seems the obvious problem from field reports but I have not tested the fix myself. Feedback welcome.
If these links are not deleted, then they will build up in the player's inventory until they can no longer log in.
Accidental deletion of links due to bugs or other causes is potentially inconvenient but on a par with items being
accidentally moved. When a link is deleted, the target of the link is never touched.
This is a general solution that accounts for the use of links anywhere in the user's inventory.
To get this to work, I had to disable the dupe link check I put in a couple of commits ago.
When the viewer adds wearables to an existing outfit, it first requests deletes of all the existing links before creating a new set.
Since these messages are async, the creates were being received before the deletes had a chance to complete, resulting in missing current outfit links.
However, the dupe check shouldn't be as important now that broken links have been fixed - it was the broken links that were causing the client to create dupes.
Tested on kokua 0.1.0 WIP and SL 2.6.3. I now have no problems managing outfits on my standalone.
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
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".