aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden
diff options
context:
space:
mode:
authorMelanie2013-07-13 00:47:58 +0100
committerMelanie2013-07-13 00:47:58 +0100
commita53a10ad270ea02e57aca7787d0b8278989eea68 (patch)
tree7ff1b6d170e828e8b9628ef13078b2cd0ecbd8b6 /OpenSim/Region/ClientStack/Linden
parentMerge branch 'master' into careminster (diff)
parentCentralize duplicated code in SceneObjectPart for subscribing to (diff)
downloadopensim-SC_OLD-a53a10ad270ea02e57aca7787d0b8278989eea68.zip
opensim-SC_OLD-a53a10ad270ea02e57aca7787d0b8278989eea68.tar.gz
opensim-SC_OLD-a53a10ad270ea02e57aca7787d0b8278989eea68.tar.bz2
opensim-SC_OLD-a53a10ad270ea02e57aca7787d0b8278989eea68.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/Framework/Scenes/SceneObjectPart.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs10
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs3
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs238
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs27
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs2
8 files changed, 164 insertions, 122 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 8241e07..98ab433 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -282,13 +282,19 @@ namespace OpenSim.Region.ClientStack.Linden
282 m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req); 282 m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req);
283 m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req); 283 m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req);
284 m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req); 284 m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req);
285 IRequestHandler getObjectPhysicsDataHandler = new RestStreamHandler("POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData); 285
286 IRequestHandler getObjectPhysicsDataHandler
287 = new RestStreamHandler(
288 "POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData, "GetObjectPhysicsData", null);
286 m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler); 289 m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler);
287 IRequestHandler getObjectCostHandler = new RestStreamHandler("POST", capsBase + m_getObjectCostPath, GetObjectCost); 290 IRequestHandler getObjectCostHandler = new RestStreamHandler("POST", capsBase + m_getObjectCostPath, GetObjectCost);
288 m_HostCapsObj.RegisterHandler("GetObjectCost", getObjectCostHandler); 291 m_HostCapsObj.RegisterHandler("GetObjectCost", getObjectCostHandler);
289 IRequestHandler ResourceCostSelectedHandler = new RestStreamHandler("POST", capsBase + m_ResourceCostSelectedPath, ResourceCostSelected); 292 IRequestHandler ResourceCostSelectedHandler = new RestStreamHandler("POST", capsBase + m_ResourceCostSelectedPath, ResourceCostSelected);
290 m_HostCapsObj.RegisterHandler("ResourceCostSelected", ResourceCostSelectedHandler); 293 m_HostCapsObj.RegisterHandler("ResourceCostSelected", ResourceCostSelectedHandler);
291 IRequestHandler UpdateAgentInformationHandler = new RestStreamHandler("POST", capsBase + m_UpdateAgentInformationPath, UpdateAgentInformation); 294
295 IRequestHandler UpdateAgentInformationHandler
296 = new RestStreamHandler(
297 "POST", capsBase + m_UpdateAgentInformationPath, UpdateAgentInformation, "UpdateAgentInformation", null);
292 m_HostCapsObj.RegisterHandler("UpdateAgentInformation", UpdateAgentInformationHandler); 298 m_HostCapsObj.RegisterHandler("UpdateAgentInformation", UpdateAgentInformationHandler);
293 299
294 m_HostCapsObj.RegisterHandler( 300 m_HostCapsObj.RegisterHandler(
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index eb40eb1..d6689d4 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -366,7 +366,8 @@ namespace OpenSim.Region.ClientStack.Linden
366 // EventQueueGet when it receive capability information, but then we replace the rest handler immediately 366 // EventQueueGet when it receive capability information, but then we replace the rest handler immediately
367 // afterwards with the poll service. So for now, we'll pass a null instead to simplify code reading, but 367 // afterwards with the poll service. So for now, we'll pass a null instead to simplify code reading, but
368 // really it should be possible to directly register the poll handler as a capability. 368 // really it should be possible to directly register the poll handler as a capability.
369 caps.RegisterHandler("EventQueueGet", new RestHTTPHandler("POST", eventQueueGetPath, null)); 369 caps.RegisterHandler(
370 "EventQueueGet", new RestHTTPHandler("POST", eventQueueGetPath, null, "EventQueueGet", null));
370// delegate(Hashtable m_dhttpMethod) 371// delegate(Hashtable m_dhttpMethod)
371// { 372// {
372// return ProcessQueue(m_dhttpMethod, agentID, caps); 373// return ProcessQueue(m_dhttpMethod, agentID, caps);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs
index 79d56c4..5196368 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs
@@ -183,7 +183,7 @@ namespace OpenSim.Region.ClientStack.Linden
183 m_isGod = m_scene.Permissions.IsGod(agentID); 183 m_isGod = m_scene.Permissions.IsGod(agentID);
184 } 184 }
185 185
186 public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 186 protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
187 { 187 {
188 StreamReader reader = new StreamReader(request); 188 StreamReader reader = new StreamReader(request);
189 string message = reader.ReadToEnd(); 189 string message = reader.ReadToEnd();
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index bba8ff1..27b09a6 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -349,6 +349,8 @@ namespace OpenSim.Region.ClientStack.Linden
349 { 349 {
350 while (true) 350 while (true)
351 { 351 {
352 Watchdog.UpdateThread();
353
352 aPollRequest poolreq = m_queue.Dequeue(); 354 aPollRequest poolreq = m_queue.Dequeue();
353 355
354 poolreq.thepoll.Process(poolreq); 356 poolreq.thepoll.Process(poolreq);
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 45c901e..dfad485 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -710,12 +710,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
710 //there is a local handler for this packet type 710 //there is a local handler for this packet type
711 if (pprocessor.Async) 711 if (pprocessor.Async)
712 { 712 {
713 ClientInfo cinfo = UDPClient.GetClientInfo();
714 if (!cinfo.AsyncRequests.ContainsKey(packet.Type.ToString()))
715 cinfo.AsyncRequests[packet.Type.ToString()] = 0;
716 cinfo.AsyncRequests[packet.Type.ToString()]++;
717
713 object obj = new AsyncPacketProcess(this, pprocessor.method, packet); 718 object obj = new AsyncPacketProcess(this, pprocessor.method, packet);
714 Util.FireAndForget(ProcessSpecificPacketAsync, obj); 719 Util.FireAndForget(ProcessSpecificPacketAsync, obj);
715 result = true; 720 result = true;
716 } 721 }
717 else 722 else
718 { 723 {
724 ClientInfo cinfo = UDPClient.GetClientInfo();
725 if (!cinfo.SyncRequests.ContainsKey(packet.Type.ToString()))
726 cinfo.SyncRequests[packet.Type.ToString()] = 0;
727 cinfo.SyncRequests[packet.Type.ToString()]++;
728
719 result = pprocessor.method(this, packet); 729 result = pprocessor.method(this, packet);
720 } 730 }
721 } 731 }
@@ -730,6 +740,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
730 } 740 }
731 if (found) 741 if (found)
732 { 742 {
743 ClientInfo cinfo = UDPClient.GetClientInfo();
744 if (!cinfo.GenericRequests.ContainsKey(packet.Type.ToString()))
745 cinfo.GenericRequests[packet.Type.ToString()] = 0;
746 cinfo.GenericRequests[packet.Type.ToString()]++;
747
733 result = method(this, packet); 748 result = method(this, packet);
734 } 749 }
735 } 750 }
@@ -5376,7 +5391,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5376 AddLocalPacketHandler(PacketType.RezObject, HandlerRezObject); 5391 AddLocalPacketHandler(PacketType.RezObject, HandlerRezObject);
5377 AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject); 5392 AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject);
5378 AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand); 5393 AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand);
5379 AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply); 5394 AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply, false);
5380 AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest); 5395 AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest);
5381 AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance); 5396 AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance);
5382 AddLocalPacketHandler(PacketType.AgentIsNowWearing, HandlerAgentIsNowWearing); 5397 AddLocalPacketHandler(PacketType.AgentIsNowWearing, HandlerAgentIsNowWearing);
@@ -5437,8 +5452,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5437 AddLocalPacketHandler(PacketType.ScriptAnswerYes, HandleScriptAnswerYes, false); 5452 AddLocalPacketHandler(PacketType.ScriptAnswerYes, HandleScriptAnswerYes, false);
5438 AddLocalPacketHandler(PacketType.ObjectClickAction, HandleObjectClickAction, false); 5453 AddLocalPacketHandler(PacketType.ObjectClickAction, HandleObjectClickAction, false);
5439 AddLocalPacketHandler(PacketType.ObjectMaterial, HandleObjectMaterial, false); 5454 AddLocalPacketHandler(PacketType.ObjectMaterial, HandleObjectMaterial, false);
5440 AddLocalPacketHandler(PacketType.RequestImage, HandleRequestImage); 5455 AddLocalPacketHandler(PacketType.RequestImage, HandleRequestImage, false);
5441 AddLocalPacketHandler(PacketType.TransferRequest, HandleTransferRequest); 5456 AddLocalPacketHandler(PacketType.TransferRequest, HandleTransferRequest, false);
5442 AddLocalPacketHandler(PacketType.AssetUploadRequest, HandleAssetUploadRequest); 5457 AddLocalPacketHandler(PacketType.AssetUploadRequest, HandleAssetUploadRequest);
5443 AddLocalPacketHandler(PacketType.RequestXfer, HandleRequestXfer); 5458 AddLocalPacketHandler(PacketType.RequestXfer, HandleRequestXfer);
5444 AddLocalPacketHandler(PacketType.SendXferPacket, HandleSendXferPacket); 5459 AddLocalPacketHandler(PacketType.SendXferPacket, HandleSendXferPacket);
@@ -5470,7 +5485,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5470 AddLocalPacketHandler(PacketType.TeleportCancel, HandleTeleportCancel); 5485 AddLocalPacketHandler(PacketType.TeleportCancel, HandleTeleportCancel);
5471 AddLocalPacketHandler(PacketType.TeleportLocationRequest, HandleTeleportLocationRequest); 5486 AddLocalPacketHandler(PacketType.TeleportLocationRequest, HandleTeleportLocationRequest);
5472 AddLocalPacketHandler(PacketType.UUIDNameRequest, HandleUUIDNameRequest, false); 5487 AddLocalPacketHandler(PacketType.UUIDNameRequest, HandleUUIDNameRequest, false);
5473 AddLocalPacketHandler(PacketType.RegionHandleRequest, HandleRegionHandleRequest); 5488 AddLocalPacketHandler(PacketType.RegionHandleRequest, HandleRegionHandleRequest, false);
5474 AddLocalPacketHandler(PacketType.ParcelInfoRequest, HandleParcelInfoRequest); 5489 AddLocalPacketHandler(PacketType.ParcelInfoRequest, HandleParcelInfoRequest);
5475 AddLocalPacketHandler(PacketType.ParcelAccessListRequest, HandleParcelAccessListRequest, false); 5490 AddLocalPacketHandler(PacketType.ParcelAccessListRequest, HandleParcelAccessListRequest, false);
5476 AddLocalPacketHandler(PacketType.ParcelAccessListUpdate, HandleParcelAccessListUpdate, false); 5491 AddLocalPacketHandler(PacketType.ParcelAccessListUpdate, HandleParcelAccessListUpdate, false);
@@ -7868,129 +7883,145 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7868 //m_log.Debug("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request"); 7883 //m_log.Debug("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request");
7869 7884
7870 TransferRequestPacket transfer = (TransferRequestPacket)Pack; 7885 TransferRequestPacket transfer = (TransferRequestPacket)Pack;
7871 //m_log.Debug("Transfer Request: " + transfer.ToString());
7872 // Validate inventory transfers
7873 // Has to be done here, because AssetCache can't do it
7874 //
7875 UUID taskID = UUID.Zero; 7886 UUID taskID = UUID.Zero;
7876 if (transfer.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) 7887 if (transfer.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
7877 { 7888 {
7878 taskID = new UUID(transfer.TransferInfo.Params, 48);
7879 UUID itemID = new UUID(transfer.TransferInfo.Params, 64);
7880 UUID requestID = new UUID(transfer.TransferInfo.Params, 80);
7881
7882// m_log.DebugFormat(
7883// "[CLIENT]: Got request for asset {0} from item {1} in prim {2} by {3}",
7884// requestID, itemID, taskID, Name);
7885
7886 if (!(((Scene)m_scene).Permissions.BypassPermissions())) 7889 if (!(((Scene)m_scene).Permissions.BypassPermissions()))
7887 { 7890 {
7888 if (taskID != UUID.Zero) // Prim 7891 // We're spawning a thread because the permissions check can block this thread
7892 Util.FireAndForget(delegate
7889 { 7893 {
7890 SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); 7894 // This requests the asset if needed
7895 HandleSimInventoryTransferRequestWithPermsCheck(sender, transfer);
7896 });
7897 return true;
7898 }
7899 }
7900 else if (transfer.TransferInfo.SourceType == (int)SourceType.SimEstate)
7901 {
7902 //TransferRequestPacket does not include covenant uuid?
7903 //get scene covenant uuid
7904 taskID = m_scene.RegionInfo.RegionSettings.Covenant;
7905 }
7891 7906
7892 if (part == null) 7907 // This is non-blocking
7893 { 7908 MakeAssetRequest(transfer, taskID);
7894 m_log.WarnFormat(
7895 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist",
7896 Name, requestID, itemID, taskID);
7897 return true;
7898 }
7899 7909
7900 TaskInventoryItem tii = part.Inventory.GetInventoryItem(itemID); 7910 return true;
7901 if (tii == null) 7911 }
7902 {
7903 m_log.WarnFormat(
7904 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist",
7905 Name, requestID, itemID, taskID);
7906 return true;
7907 }
7908 7912
7909 if (tii.Type == (int)AssetType.LSLText) 7913 private void HandleSimInventoryTransferRequestWithPermsCheck(IClientAPI sender, TransferRequestPacket transfer)
7910 { 7914 {
7911 if (!((Scene)m_scene).Permissions.CanEditScript(itemID, taskID, AgentId)) 7915 UUID taskID = new UUID(transfer.TransferInfo.Params, 48);
7912 return true; 7916 UUID itemID = new UUID(transfer.TransferInfo.Params, 64);
7913 } 7917 UUID requestID = new UUID(transfer.TransferInfo.Params, 80);
7914 else if (tii.Type == (int)AssetType.Notecard)
7915 {
7916 if (!((Scene)m_scene).Permissions.CanEditNotecard(itemID, taskID, AgentId))
7917 return true;
7918 }
7919 else
7920 {
7921 // TODO: Change this code to allow items other than notecards and scripts to be successfully
7922 // shared with group. In fact, this whole block of permissions checking should move to an IPermissionsModule
7923 if (part.OwnerID != AgentId)
7924 {
7925 m_log.WarnFormat(
7926 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}",
7927 Name, requestID, itemID, taskID, part.OwnerID);
7928 return true;
7929 }
7930 7918
7931 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 7919 //m_log.DebugFormat(
7932 { 7920 // "[CLIENT]: Got request for asset {0} from item {1} in prim {2} by {3}",
7933 m_log.WarnFormat( 7921 // requestID, itemID, taskID, Name);
7934 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set",
7935 Name, requestID, itemID, taskID);
7936 return true;
7937 }
7938 7922
7939 if (tii.OwnerID != AgentId) 7923 //m_log.Debug("Transfer Request: " + transfer.ToString());
7940 { 7924 // Validate inventory transfers
7941 m_log.WarnFormat( 7925 // Has to be done here, because AssetCache can't do it
7942 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}", 7926 //
7943 Name, requestID, itemID, taskID, tii.OwnerID); 7927 if (taskID != UUID.Zero) // Prim
7944 return true; 7928 {
7945 } 7929 SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID);
7946 7930
7947 if (( 7931 if (part == null)
7948 tii.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) 7932 {
7949 != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) 7933 m_log.WarnFormat(
7950 { 7934 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist",
7951 m_log.WarnFormat( 7935 Name, requestID, itemID, taskID);
7952 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer", 7936 return;
7953 Name, requestID, itemID, taskID); 7937 }
7954 return true;
7955 }
7956 7938
7957 if (tii.AssetID != requestID) 7939 TaskInventoryItem tii = part.Inventory.GetInventoryItem(itemID);
7958 { 7940 if (tii == null)
7959 m_log.WarnFormat( 7941 {
7960 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}", 7942 m_log.WarnFormat(
7961 Name, requestID, itemID, taskID, tii.AssetID); 7943 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist",
7962 return true; 7944 Name, requestID, itemID, taskID);
7963 } 7945 return;
7964 } 7946 }
7947
7948 if (tii.Type == (int)AssetType.LSLText)
7949 {
7950 if (!((Scene)m_scene).Permissions.CanEditScript(itemID, taskID, AgentId))
7951 return;
7952 }
7953 else if (tii.Type == (int)AssetType.Notecard)
7954 {
7955 if (!((Scene)m_scene).Permissions.CanEditNotecard(itemID, taskID, AgentId))
7956 return;
7957 }
7958 else
7959 {
7960 // TODO: Change this code to allow items other than notecards and scripts to be successfully
7961 // shared with group. In fact, this whole block of permissions checking should move to an IPermissionsModule
7962 if (part.OwnerID != AgentId)
7963 {
7964 m_log.WarnFormat(
7965 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}",
7966 Name, requestID, itemID, taskID, part.OwnerID);
7967 return;
7965 } 7968 }
7966 else // Agent 7969
7970 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
7967 { 7971 {
7968 IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); 7972 m_log.WarnFormat(
7969 if (invAccess != null) 7973 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set",
7970 { 7974 Name, requestID, itemID, taskID);
7971 if (!invAccess.CanGetAgentInventoryItem(this, itemID, requestID)) 7975 return;
7972 return false; 7976 }
7973 } 7977
7974 else 7978 if (tii.OwnerID != AgentId)
7975 { 7979 {
7976 return false; 7980 m_log.WarnFormat(
7977 } 7981 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}",
7982 Name, requestID, itemID, taskID, tii.OwnerID);
7983 return;
7984 }
7985
7986 if ((
7987 tii.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7988 != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7989 {
7990 m_log.WarnFormat(
7991 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer",
7992 Name, requestID, itemID, taskID);
7993 return;
7994 }
7995
7996 if (tii.AssetID != requestID)
7997 {
7998 m_log.WarnFormat(
7999 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}",
8000 Name, requestID, itemID, taskID, tii.AssetID);
8001 return;
7978 } 8002 }
7979 } 8003 }
7980 } 8004 }
7981 else 8005 else // Agent
7982 if (transfer.TransferInfo.SourceType == (int)SourceType.SimEstate) 8006 {
8007 IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
8008 if (invAccess != null)
8009 {
8010 if (!invAccess.CanGetAgentInventoryItem(this, itemID, requestID))
8011 return;
8012 }
8013 else
7983 { 8014 {
7984 //TransferRequestPacket does not include covenant uuid? 8015 return;
7985 //get scene covenant uuid
7986 taskID = m_scene.RegionInfo.RegionSettings.Covenant;
7987 } 8016 }
8017 }
7988 8018
8019 // Permissions out of the way, let's request the asset
7989 MakeAssetRequest(transfer, taskID); 8020 MakeAssetRequest(transfer, taskID);
7990 8021
7991 return true;
7992 } 8022 }
7993 8023
8024
7994 private bool HandleAssetUploadRequest(IClientAPI sender, Packet Pack) 8025 private bool HandleAssetUploadRequest(IClientAPI sender, Packet Pack)
7995 { 8026 {
7996 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; 8027 AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
@@ -12378,7 +12409,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12378 ClientInfo info = m_udpClient.GetClientInfo(); 12409 ClientInfo info = m_udpClient.GetClientInfo();
12379 12410
12380 info.proxyEP = null; 12411 info.proxyEP = null;
12381 info.agentcircuit = RequestClientInfo(); 12412 if (info.agentcircuit == null)
12413 info.agentcircuit = RequestClientInfo();
12382 12414
12383 return info; 12415 return info;
12384 } 12416 }
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
index e52ac37..f7ed14d 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
@@ -160,6 +160,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
160 private int m_maxRTO = 60000; 160 private int m_maxRTO = 60000;
161 public bool m_deliverPackets = true; 161 public bool m_deliverPackets = true;
162 162
163 private ClientInfo m_info = new ClientInfo();
164
163 /// <summary> 165 /// <summary>
164 /// Default constructor 166 /// Default constructor
165 /// </summary> 167 /// </summary>
@@ -241,20 +243,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
241 // TODO: This data structure is wrong in so many ways. Locking and copying the entire lists 243 // TODO: This data structure is wrong in so many ways. Locking and copying the entire lists
242 // of pending and needed ACKs for every client every time some method wants information about 244 // of pending and needed ACKs for every client every time some method wants information about
243 // this connection is a recipe for poor performance 245 // this connection is a recipe for poor performance
244 ClientInfo info = new ClientInfo(); 246
245 info.pendingAcks = new Dictionary<uint, uint>(); 247 m_info.resendThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Resend].DripRate;
246 info.needAck = new Dictionary<uint, byte[]>(); 248 m_info.landThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Land].DripRate;
247 249 m_info.windThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Wind].DripRate;
248 info.resendThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Resend].DripRate; 250 m_info.cloudThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Cloud].DripRate;
249 info.landThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Land].DripRate; 251 m_info.taskThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Task].DripRate;
250 info.windThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Wind].DripRate; 252 m_info.assetThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Asset].DripRate;
251 info.cloudThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Cloud].DripRate; 253 m_info.textureThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Texture].DripRate;
252 info.taskThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Task].DripRate; 254 m_info.totalThrottle = (int)m_throttleCategory.DripRate;
253 info.assetThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Asset].DripRate; 255
254 info.textureThrottle = (int)m_throttleCategories[(int)ThrottleOutPacketType.Texture].DripRate; 256 return m_info;
255 info.totalThrottle = (int)m_throttleCategory.DripRate;
256
257 return info;
258 } 257 }
259 258
260 /// <summary> 259 /// <summary>
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 7f14371..8a1f267 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -1686,6 +1686,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1686 { 1686 {
1687 IncomingPacket incomingPacket = null; 1687 IncomingPacket incomingPacket = null;
1688 1688
1689 /*
1689 // HACK: This is a test to try and rate limit packet handling on Mono. 1690 // HACK: This is a test to try and rate limit packet handling on Mono.
1690 // If it works, a more elegant solution can be devised 1691 // If it works, a more elegant solution can be devised
1691 if (Util.FireAndForgetCount() < 2) 1692 if (Util.FireAndForgetCount() < 2)
@@ -1693,6 +1694,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1693 //m_log.Debug("[LLUDPSERVER]: Incoming packet handler is sleeping"); 1694 //m_log.Debug("[LLUDPSERVER]: Incoming packet handler is sleeping");
1694 Thread.Sleep(30); 1695 Thread.Sleep(30);
1695 } 1696 }
1697 */
1696 1698
1697 if (packetInbox.Dequeue(100, ref incomingPacket)) 1699 if (packetInbox.Dequeue(100, ref incomingPacket))
1698 { 1700 {
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
index a0e0078..83144e3 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
73 } 73 }
74 74
75 [SetUp] 75 [SetUp]
76 public void SetUp() 76 public override void SetUp()
77 { 77 {
78 base.SetUp(); 78 base.SetUp();
79 79