log problems when an asset request through the UDP TransferRequest channel goes wrong

slimupdates
Justin Clark-Casey (justincc) 2010-04-19 20:06:55 +01:00
parent 7ef6dc2bac
commit 855eda844f
1 changed files with 45 additions and 2 deletions

View File

@ -7091,32 +7091,75 @@ namespace OpenSim.Region.ClientStack.LindenUDP
taskID = new UUID(transfer.TransferInfo.Params, 48); taskID = new UUID(transfer.TransferInfo.Params, 48);
UUID itemID = new UUID(transfer.TransferInfo.Params, 64); UUID itemID = new UUID(transfer.TransferInfo.Params, 64);
UUID requestID = new UUID(transfer.TransferInfo.Params, 80); UUID requestID = new UUID(transfer.TransferInfo.Params, 80);
// m_log.DebugFormat(
// "[LLCLIENTVIEW]: Got request for asset {0} from item {1} in prim {2} by {3}",
// requestID, itemID, taskID, Name);
if (!(((Scene)m_scene).Permissions.BypassPermissions())) if (!(((Scene)m_scene).Permissions.BypassPermissions()))
{ {
if (taskID != UUID.Zero) // Prim if (taskID != UUID.Zero) // Prim
{ {
SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID);
if (part == null) if (part == null)
{
m_log.WarnFormat(
"[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist",
Name, requestID, itemID, taskID);
return true; return true;
}
if (part.OwnerID != AgentId) if (part.OwnerID != AgentId)
{
m_log.WarnFormat(
"[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}",
Name, requestID, itemID, taskID, part.OwnerID);
return true; return true;
}
if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
{
m_log.WarnFormat(
"[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set",
Name, requestID, itemID, taskID);
return true; return true;
}
TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID); TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
if (ti == null) if (ti == null)
{
m_log.WarnFormat(
"[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but item does not exist",
Name, requestID, itemID, taskID);
return true; return true;
}
if (ti.OwnerID != AgentId) if (ti.OwnerID != AgentId)
{
m_log.WarnFormat(
"[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}",
Name, requestID, itemID, taskID, ti.OwnerID);
return true; return true;
}
if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) if ((
ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
!= ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
{
m_log.WarnFormat(
"[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer",
Name, requestID, itemID, taskID);
return true; return true;
}
if (ti.AssetID != requestID) if (ti.AssetID != requestID)
{
m_log.WarnFormat(
"[LLCLIENTVIEW]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}",
Name, requestID, itemID, taskID, ti.AssetID);
return true; return true;
}
} }
else // Agent else // Agent
{ {
@ -11389,7 +11432,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// } // }
} }
//m_log.DebugFormat("[LLCLIENTVIEW]: {0} requesting asset {1}", Name, requestID); // m_log.DebugFormat("[LLCLIENTVIEW]: {0} requesting asset {1}", Name, requestID);
m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
} }