aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authoropensim mirror account2010-12-01 18:10:02 -0800
committeropensim mirror account2010-12-01 18:10:02 -0800
commit3da12c2d3f53be4319ad408a19801675f3a9513a (patch)
treed4ce71333504fef05419ba27cbfbeabcaad0f4c1 /OpenSim/Region
parentMerge branch 'master' of /var/git/opensim/ (diff)
parentStop LLUDPServer sending updates after object deletes by always queueing deletes (diff)
downloadopensim-SC_OLD-3da12c2d3f53be4319ad408a19801675f3a9513a.zip
opensim-SC_OLD-3da12c2d3f53be4319ad408a19801675f3a9513a.tar.gz
opensim-SC_OLD-3da12c2d3f53be4319ad408a19801675f3a9513a.tar.bz2
opensim-SC_OLD-3da12c2d3f53be4319ad408a19801675f3a9513a.tar.xz
Merge branch 'master' of /var/git/opensim/
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs32
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs15
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs22
3 files changed, 50 insertions, 19 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 7851c4d..f125822 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3562,24 +3562,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3562 EntityUpdate update; 3562 EntityUpdate update;
3563 while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update)) 3563 while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update))
3564 { 3564 {
3565 // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
3566 // will never receive an update after a prim kill. Even then, keeping the kill record may be a good
3567 // safety measure.
3568 //
3569 // Receiving updates after kills results in undeleteable prims that persist until relog and
3570 // currently occurs because prims can be deleted before all queued updates are sent.
3571 if (m_killRecord.Contains(update.Entity.LocalId))
3572 {
3573// m_log.WarnFormat(
3574// "[CLIENT]: Preventing full update for prim with local id {0} after client for user {1} told it was deleted",
3575// update.Entity.LocalId, Name);
3576 continue;
3577 }
3578
3579 if (update.Entity is SceneObjectPart) 3565 if (update.Entity is SceneObjectPart)
3580 { 3566 {
3581 SceneObjectPart part = (SceneObjectPart)update.Entity; 3567 SceneObjectPart part = (SceneObjectPart)update.Entity;
3582 3568
3569 // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
3570 // will never receive an update after a prim kill. Even then, keeping the kill record may be a good
3571 // safety measure.
3572 //
3573 // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update
3574 // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs
3575 // updates and kills on different threads with different scheduling strategies, hence this protection.
3576 //
3577 // This doesn't appear to apply to child prims - a client will happily ignore these updates
3578 // after the root prim has been deleted.
3579 if (m_killRecord.Contains(part.LocalId))
3580 {
3581 // m_log.WarnFormat(
3582 // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted",
3583 // part.LocalId, Name);
3584 continue;
3585 }
3586
3583 if (part.ParentGroup.IsAttachment && m_disableFacelights) 3587 if (part.ParentGroup.IsAttachment && m_disableFacelights)
3584 { 3588 {
3585 if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && 3589 if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand &&
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
index c4db5da..e02783a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs
@@ -399,7 +399,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
399 return data; 399 return data;
400 } 400 }
401 401
402 public bool EnqueueOutgoing(OutgoingPacket packet) 402 /// <summary>
403 /// Queue an outgoing packet if appropriate.
404 /// </summary>
405 /// <param name="packet"></param>
406 /// <param name="forceQueue">Always queue the packet if at all possible.</param>
407 /// <returns>
408 /// true if the packet has been queued,
409 /// false if the packet has not been queued and should be sent immediately.
410 /// </returns>
411 public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue)
403 { 412 {
404 int category = (int)packet.Category; 413 int category = (int)packet.Category;
405 414
@@ -408,14 +417,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
408 OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; 417 OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category];
409 TokenBucket bucket = m_throttleCategories[category]; 418 TokenBucket bucket = m_throttleCategories[category];
410 419
411 if (bucket.RemoveTokens(packet.Buffer.DataLength)) 420 if (!forceQueue && bucket.RemoveTokens(packet.Buffer.DataLength))
412 { 421 {
413 // Enough tokens were removed from the bucket, the packet will not be queued 422 // Enough tokens were removed from the bucket, the packet will not be queued
414 return false; 423 return false;
415 } 424 }
416 else 425 else
417 { 426 {
418 // Not enough tokens in the bucket, queue this packet 427 // Force queue specified or not enough tokens in the bucket, queue this packet
419 queue.Enqueue(packet); 428 queue.Enqueue(packet);
420 return true; 429 return true;
421 } 430 }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index b5d8ec8..e54cfc2 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -312,6 +312,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
312 } 312 }
313 } 313 }
314 314
315 /// <summary>
316 /// Start the process of sending a packet to the client.
317 /// </summary>
318 /// <param name="udpClient"></param>
319 /// <param name="packet"></param>
320 /// <param name="category"></param>
321 /// <param name="allowSplitting"></param>
315 public void SendPacket(LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting) 322 public void SendPacket(LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting)
316 { 323 {
317 // CoarseLocationUpdate packets cannot be split in an automated way 324 // CoarseLocationUpdate packets cannot be split in an automated way
@@ -339,6 +346,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
339 } 346 }
340 } 347 }
341 348
349 /// <summary>
350 /// Start the process of sending a packet to the client.
351 /// </summary>
352 /// <param name="udpClient"></param>
353 /// <param name="data"></param>
354 /// <param name="type"></param>
355 /// <param name="category"></param>
342 public void SendPacketData(LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category) 356 public void SendPacketData(LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category)
343 { 357 {
344 int dataLength = data.Length; 358 int dataLength = data.Length;
@@ -396,7 +410,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
396 410
397 OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category); 411 OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category);
398 412
399 if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) 413 // If a Linden Lab 1.23.5 client receives an update packet after a kill packet for an object, it will
414 // continue to display the deleted object until relog. Therefore, we need to always queue a kill object
415 // packet so that it isn't sent before a queued update packet.
416 bool requestQueue = type == PacketType.KillObject;
417 if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue))
400 SendPacketFinal(outgoingPacket); 418 SendPacketFinal(outgoingPacket);
401 419
402 #endregion Queue or Send 420 #endregion Queue or Send
@@ -489,7 +507,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
489 //Interlocked.Increment(ref Stats.ResentPackets); 507 //Interlocked.Increment(ref Stats.ResentPackets);
490 508
491 // Requeue or resend the packet 509 // Requeue or resend the packet
492 if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) 510 if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, false))
493 SendPacketFinal(outgoingPacket); 511 SendPacketFinal(outgoingPacket);
494 } 512 }
495 } 513 }