From 53c951bc526407ad3180d435181bc8f1ee7dab69 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Fri, 24 Jan 2020 01:21:50 -0500 Subject: [PATCH] Revert "Another experiment for memory leaks: Create a brand-new buffer for passthrough uncompressed content" This reverts commit 92571a65db5ccce552182b49753b9e5087091063. It looks like c3fab89bd7edb696cc2c981110ebec4ff21f129b nabbed it at last. --- .../proxy/protocol/netty/MinecraftCompressDecoder.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressDecoder.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressDecoder.java index f76e82f95..cf68e134b 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressDecoder.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressDecoder.java @@ -29,8 +29,7 @@ public class MinecraftCompressDecoder extends MessageToMessageDecoder { int claimedUncompressedSize = ProtocolUtils.readVarInt(in); if (claimedUncompressedSize == 0) { // Strip the now-useless uncompressed size, this message is already uncompressed. - out.add(in.copy()); - in.skipBytes(in.readableBytes()); + out.add(in.retainedSlice()); return; }