Another experiment for memory leaks: Create a brand-new buffer for passthrough uncompressed content

This commit is contained in:
Andrew Steinborn
2020-01-14 22:18:05 -05:00
parent c14ceb315d
commit 92571a65db

View File

@@ -29,7 +29,8 @@ public class MinecraftCompressDecoder extends MessageToMessageDecoder<ByteBuf> {
int claimedUncompressedSize = ProtocolUtils.readVarInt(in);
if (claimedUncompressedSize == 0) {
// Strip the now-useless uncompressed size, this message is already uncompressed.
out.add(in.retainedSlice());
out.add(in.copy());
in.skipBytes(in.readableBytes());
return;
}