diff options
author | Justin Clark-Casey (justincc) | 2013-10-24 00:33:14 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-10-24 00:33:14 +0100 |
commit | 5d61c4039dd4f22b20875a0a9dee72179642da9c (patch) | |
tree | 9f08f03fd19f6981af66aae69837763445d197c0 /OpenSim/Region/ClientStack | |
parent | BulletSim: change collision flags for groundplane to not interact with static... (diff) | |
download | opensim-SC-5d61c4039dd4f22b20875a0a9dee72179642da9c.zip opensim-SC-5d61c4039dd4f22b20875a0a9dee72179642da9c.tar.gz opensim-SC-5d61c4039dd4f22b20875a0a9dee72179642da9c.tar.bz2 opensim-SC-5d61c4039dd4f22b20875a0a9dee72179642da9c.tar.xz |
Only set the data present event if we actually queued an outoing packet (not if we sent immediately)
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 8d957dc..981f7ef 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -919,6 +919,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
919 | if (packet.Type == PacketType.CoarseLocationUpdate && allowSplitting) | 919 | if (packet.Type == PacketType.CoarseLocationUpdate && allowSplitting) |
920 | allowSplitting = false; | 920 | allowSplitting = false; |
921 | 921 | ||
922 | bool packetQueued = false; | ||
923 | |||
922 | if (allowSplitting && packet.HasVariableBlocks) | 924 | if (allowSplitting && packet.HasVariableBlocks) |
923 | { | 925 | { |
924 | byte[][] datas = packet.ToBytesMultiple(); | 926 | byte[][] datas = packet.ToBytesMultiple(); |
@@ -930,18 +932,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
930 | for (int i = 0; i < packetCount; i++) | 932 | for (int i = 0; i < packetCount; i++) |
931 | { | 933 | { |
932 | byte[] data = datas[i]; | 934 | byte[] data = datas[i]; |
933 | SendPacketData(udpClient, data, packet.Type, category, method); | 935 | |
936 | if (!SendPacketData(udpClient, data, packet.Type, category, method)) | ||
937 | packetQueued = true; | ||
934 | } | 938 | } |
935 | } | 939 | } |
936 | else | 940 | else |
937 | { | 941 | { |
938 | byte[] data = packet.ToBytes(); | 942 | byte[] data = packet.ToBytes(); |
939 | SendPacketData(udpClient, data, packet.Type, category, method); | 943 | packetQueued = SendPacketData(udpClient, data, packet.Type, category, method); |
940 | } | 944 | } |
941 | 945 | ||
942 | PacketPool.Instance.ReturnPacket(packet); | 946 | PacketPool.Instance.ReturnPacket(packet); |
943 | 947 | ||
944 | m_dataPresentEvent.Set(); | 948 | if (packetQueued) |
949 | m_dataPresentEvent.Set(); | ||
945 | } | 950 | } |
946 | 951 | ||
947 | /// <summary> | 952 | /// <summary> |
@@ -955,7 +960,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
955 | /// The method to call if the packet is not acked by the client. If null, then a standard | 960 | /// The method to call if the packet is not acked by the client. If null, then a standard |
956 | /// resend of the packet is done. | 961 | /// resend of the packet is done. |
957 | /// </param> | 962 | /// </param> |
958 | public void SendPacketData( | 963 | /// <returns>true if the data was sent immediately, false if it was queued for sending</returns> |
964 | public bool SendPacketData( | ||
959 | LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category, UnackedPacketMethod method) | 965 | LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category, UnackedPacketMethod method) |
960 | { | 966 | { |
961 | int dataLength = data.Length; | 967 | int dataLength = data.Length; |
@@ -1020,7 +1026,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1020 | // packet so that it isn't sent before a queued update packet. | 1026 | // packet so that it isn't sent before a queued update packet. |
1021 | bool requestQueue = type == PacketType.KillObject; | 1027 | bool requestQueue = type == PacketType.KillObject; |
1022 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue)) | 1028 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue)) |
1029 | { | ||
1023 | SendPacketFinal(outgoingPacket); | 1030 | SendPacketFinal(outgoingPacket); |
1031 | return true; | ||
1032 | } | ||
1033 | else | ||
1034 | { | ||
1035 | return false; | ||
1036 | } | ||
1024 | 1037 | ||
1025 | #endregion Queue or Send | 1038 | #endregion Queue or Send |
1026 | } | 1039 | } |