From a8dc07ff5c0ba1c09e9a5beaf76f3b078670c74f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 22 Sep 2015 18:39:59 +0100 Subject: removed a protocol breaking lludp debug option that no one should try, changed terrain send throotle to be by packets in queue, reduced odds of MTU violation on terrain send (still bad). Most UDP protocol implementations may not mind much, but our code still does --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 23 ++++------------------ 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 7c5aee7..3b0c775 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -1209,8 +1209,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP public virtual bool CanSendLayerData() { - int n = m_udpClient.GetCatBytesInSendQueue(ThrottleOutPacketType.Land); - if ( n > 100000) + int n = m_udpClient.GetPacketsQueuedCount(ThrottleOutPacketType.Land); + if ( n > 256) return false; return true; } @@ -1355,15 +1355,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { try { - /* test code using the terrain compressor in libOpenMetaverse - int[] patchInd = new int[1]; - patchInd[0] = px + (py * Constants.TerrainPatchSize); - LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(terrData.GetFloatsSerialized(), patchInd); - */ - // Many, many patches could have been passed to us. Since the patches will be compressed - // into variable sized blocks, we cannot pre-compute how many will fit into one - // packet. While some fancy packing algorithm is possible, 4 seems to always fit. - int PatchesAssumedToFit = 4; + int PatchesAssumedToFit = 3; for (int pcnt = 0; pcnt < px.Length; pcnt += PatchesAssumedToFit) { int remaining = Math.Min(px.Length - pcnt, PatchesAssumedToFit); @@ -1377,10 +1369,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLandPacket(terrData, xPatches, yPatches); // DebugSendingPatches("SendLayerDataInternal", xPatches, yPatches); - SendTheLayerPacket(layerpack); + OutPacket(layerpack, ThrottleOutPacketType.Land); } - // LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLandPacket(terrData, px, py); - } catch (Exception e) { @@ -1388,11 +1378,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } - private void SendTheLayerPacket(LayerDataPacket layerpack) - { - OutPacket(layerpack, ThrottleOutPacketType.Land); - } - /// /// Send the wind matrix to the client /// -- cgit v1.1