Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

iar_mods
BlueWall 2012-01-03 12:22:13 -05:00
commit e78a3913e0
7 changed files with 109 additions and 84 deletions

View File

@ -240,78 +240,84 @@ namespace OpenSim.Capabilities.Handlers
if (containingFolder != null) if (containingFolder != null)
{ {
// m_log.DebugFormat(
// "[WEB FETCH INV DESC HANDLER]: Retrieved folder {0} {1} for agent id {2}",
// containingFolder.Name, containingFolder.ID, agentID);
version = containingFolder.Version; version = containingFolder.Version;
//
if (fetchItems) // if (fetchItems)
{ // {
/* // List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>();
List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>(); //
// foreach (InventoryItemBase item in contents.Items)
foreach (InventoryItemBase item in contents.Items) // {
{ // if (item.AssetType == (int)AssetType.Link)
if (item.AssetType == (int)AssetType.Link) // {
{ // InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID)); //
// // Take care of genuinely broken links where the target doesn't exist
// Take care of genuinely broken links where the target doesn't exist // // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
// HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, // // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
// but no viewer has been observed to set these up and this is the lazy way of avoiding cycles // // rather than having to keep track of every folder requested in the recursion.
// rather than having to keep track of every folder requested in the recursion. // if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link && linkedItem.AssetType == (int)AssetType.Object) // linkedItemsToAdd.Insert(0, linkedItem);
linkedItemsToAdd.Add(linkedItem); // }
} // }
} //
// foreach (InventoryItemBase linkedItem in linkedItemsToAdd)
foreach (InventoryItemBase linkedItem in linkedItemsToAdd) // {
{ // m_log.DebugFormat(
m_log.DebugFormat( // "[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}",
"[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}", // linkedItem.Name, folderID, agentID);
linkedItem.Name, folderID, agentID); //
// contents.Items.Add(linkedItem);
contents.Items.Insert(0, linkedItem); // }
} //
*/ // // If the folder requested contains links, then we need to send those folders first, otherwise the links
// // will be broken in the viewer.
/* // HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>();
// If the folder requested contains links, then we need to send those folders first, otherwise the links // foreach (InventoryItemBase item in contents.Items)
// will be broken in the viewer. // {
HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>(); // if (item.AssetType == (int)AssetType.Link)
foreach (InventoryItemBase item in contents.Items) // {
{ // InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
if (item.AssetType == (int)AssetType.Link) //
{ // // Take care of genuinely broken links where the target doesn't exist
InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID)); // // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
// // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
// Take care of genuinely broken links where the target doesn't exist // // rather than having to keep track of every folder requested in the recursion.
// HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, // if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
// but no viewer has been observed to set these up and this is the lazy way of avoiding cycles // {
// rather than having to keep track of every folder requested in the recursion. // // We don't need to send the folder if source and destination of the link are in the same
if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link) // // folder.
{ // if (linkedItem.Folder != containingFolder.ID)
// We don't need to send the folder if source and destination of the link are in the same // linkedItemFolderIdsToSend.Add(linkedItem.Folder);
// folder. // }
if (linkedItem.Folder != containingFolder.ID) // }
linkedItemFolderIdsToSend.Add(linkedItem.Folder); // }
} //
} // foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
} // {
// m_log.DebugFormat(
foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend) // "[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}",
{ // linkedItemFolderId, folderID, agentID);
m_log.DebugFormat( //
"[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}", // int dummyVersion;
linkedItemFolderId, folderID, agentID); // InventoryCollection linkedCollection
// = Fetch(
int dummyVersion; // agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion);
InventoryCollection linkedCollection //
= Fetch( // InventoryFolderBase linkedFolder = new InventoryFolderBase(linkedItemFolderId);
agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion); // linkedFolder.Owner = agentID;
// linkedFolder = m_InventoryService.GetFolder(linkedFolder);
contents.Folders.AddRange(linkedCollection.Folders); //
contents.Items.AddRange(linkedCollection.Items); //// contents.Folders.AddRange(linkedCollection.Folders);
} //
*/ // contents.Folders.Add(linkedFolder);
} // contents.Items.AddRange(linkedCollection.Items);
// }
// }
} }
} }
else else

View File

@ -56,9 +56,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public IAssetService AssetService; public IAssetService AssetService;
public UUID AgentID; public UUID AgentID;
public IInventoryAccessModule InventoryAccessModule; public IInventoryAccessModule InventoryAccessModule;
public OpenJPEG.J2KLayerInfo[] Layers; private OpenJPEG.J2KLayerInfo[] m_layers;
public bool IsDecoded; public bool IsDecoded { get; private set; }
public bool HasAsset; public bool HasAsset { get; private set; }
public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle; public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle;
private uint m_currentPacket; private uint m_currentPacket;
@ -170,14 +170,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (DiscardLevel >= 0 || m_stopPacket == 0) if (DiscardLevel >= 0 || m_stopPacket == 0)
{ {
// This shouldn't happen, but if it does, we really can't proceed // This shouldn't happen, but if it does, we really can't proceed
if (Layers == null) if (m_layers == null)
{ {
m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer"); m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer");
m_currentPacket = m_stopPacket; m_currentPacket = m_stopPacket;
return; return;
} }
int maxDiscardLevel = Math.Max(0, Layers.Length - 1); int maxDiscardLevel = Math.Max(0, m_layers.Length - 1);
// Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel // Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel
if (DiscardLevel < 0 && m_stopPacket == 0) if (DiscardLevel < 0 && m_stopPacket == 0)
@ -187,9 +187,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel); DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel);
//Calculate the m_stopPacket //Calculate the m_stopPacket
if (Layers.Length > 0) if (m_layers.Length > 0)
{ {
m_stopPacket = (uint)GetPacketForBytePosition(Layers[(Layers.Length - 1) - DiscardLevel].End); m_stopPacket = (uint)GetPacketForBytePosition(m_layers[(m_layers.Length - 1) - DiscardLevel].End);
//I don't know why, but the viewer seems to expect the final packet if the file //I don't know why, but the viewer seems to expect the final packet if the file
//is just one packet bigger. //is just one packet bigger.
if (TexturePacketCount() == m_stopPacket + 1) if (TexturePacketCount() == m_stopPacket + 1)
@ -341,7 +341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers) private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)
{ {
Layers = layers; m_layers = layers;
IsDecoded = true; IsDecoded = true;
RunUpdate(); RunUpdate();
} }

View File

@ -39,6 +39,9 @@ using log4net;
namespace OpenSim.Region.ClientStack.LindenUDP namespace OpenSim.Region.ClientStack.LindenUDP
{ {
/// <summary>
/// This class handles UDP texture requests.
/// </summary>
public class LLImageManager public class LLImageManager
{ {
private sealed class J2KImageComparer : IComparer<J2KImage> private sealed class J2KImageComparer : IComparer<J2KImage>
@ -208,7 +211,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region Priority Queue Helpers #region Priority Queue Helpers
J2KImage GetHighestPriorityImage() private J2KImage GetHighestPriorityImage()
{ {
J2KImage image = null; J2KImage image = null;
@ -223,23 +226,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return image; return image;
} }
void AddImageToQueue(J2KImage image) private void AddImageToQueue(J2KImage image)
{ {
image.PriorityQueueHandle = null; image.PriorityQueueHandle = null;
lock (m_syncRoot) lock (m_syncRoot)
{
try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); } try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); }
catch (Exception) { } catch (Exception) { }
}
} }
void RemoveImageFromQueue(J2KImage image) private void RemoveImageFromQueue(J2KImage image)
{ {
lock (m_syncRoot) lock (m_syncRoot)
{
try { m_priorityQueue.Delete(image.PriorityQueueHandle); } try { m_priorityQueue.Delete(image.PriorityQueueHandle); }
catch (Exception) { } catch (Exception) { }
}
} }
void UpdateImageInQueue(J2KImage image) private void UpdateImageInQueue(J2KImage image)
{ {
lock (m_syncRoot) lock (m_syncRoot)
{ {
@ -254,4 +261,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion Priority Queue Helpers #endregion Priority Queue Helpers
} }
} }

View File

@ -152,6 +152,9 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
/// <param name="j2kData">JPEG2000 data</param> /// <param name="j2kData">JPEG2000 data</param>
private void DoJ2KDecode(UUID assetID, byte[] j2kData) private void DoJ2KDecode(UUID assetID, byte[] j2kData)
{ {
// m_log.DebugFormat(
// "[J2KDecoderModule]: Doing J2K decoding of {0} bytes for asset {1}", j2kData.Length, assetID);
//int DecodeTime = 0; //int DecodeTime = 0;
//DecodeTime = Environment.TickCount; //DecodeTime = Environment.TickCount;
OpenJPEG.J2KLayerInfo[] layers; OpenJPEG.J2KLayerInfo[] layers;

View File

@ -170,6 +170,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
public AssetBase GetCached(string id) public AssetBase GetCached(string id)
{ {
// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Cache request for {0}", id);
if (m_Cache != null) if (m_Cache != null)
return m_Cache.Get(id); return m_Cache.Get(id);

View File

@ -2822,6 +2822,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_global_contactcount = 0; m_global_contactcount = 0;
d.WorldQuickStep(world, ODE_STEPSIZE); d.WorldQuickStep(world, ODE_STEPSIZE);
d.JointGroupEmpty(contactgroup); d.JointGroupEmpty(contactgroup);
} }
catch (Exception e) catch (Exception e)

View File

@ -100,6 +100,8 @@ namespace OpenSim.Services.Connectors
public AssetBase Get(string id) public AssetBase Get(string id)
{ {
// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Synchronous get request for {0}", id);
string uri = m_ServerURI + "/assets/" + id; string uri = m_ServerURI + "/assets/" + id;
AssetBase asset = null; AssetBase asset = null;
@ -119,6 +121,8 @@ namespace OpenSim.Services.Connectors
public AssetBase GetCached(string id) public AssetBase GetCached(string id)
{ {
// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Cache request for {0}", id);
if (m_Cache != null) if (m_Cache != null)
return m_Cache.Get(id); return m_Cache.Get(id);
@ -177,6 +181,8 @@ namespace OpenSim.Services.Connectors
public bool Get(string id, Object sender, AssetRetrieved handler) public bool Get(string id, Object sender, AssetRetrieved handler)
{ {
// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Potentially asynchronous get request for {0}", id);
string uri = m_ServerURI + "/assets/" + id; string uri = m_ServerURI + "/assets/" + id;
AssetBase asset = null; AssetBase asset = null;