From 72fbc45a19eab04184e1e3e97ad7be6818d97742 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 27 May 2014 17:59:53 -0400 Subject: [PATCH] If a packet is not handled by the channel, log it, and clear it. Could be spammy, but this is a serious bug and could cause a memory leak otherwise. --- .../mods/fml/common/network/internal/FMLProxyPacket.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java b/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java index a732518ff..82d42d9ee 100644 --- a/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java +++ b/fml/src/main/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java @@ -12,6 +12,7 @@ import net.minecraft.network.play.client.C17PacketCustomPayload; import net.minecraft.network.play.server.S3FPacketCustomPayload; import org.apache.logging.log4j.Level; import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.network.FMLNetworkException; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.handshake.NetworkDispatcher; @@ -68,7 +69,11 @@ public class FMLProxyPacket extends Packet { internalChannel.attr(NetworkRegistry.NET_HANDLER).set(this.netHandler); try { - internalChannel.writeInbound(this); + if (internalChannel.writeInbound(this)) + { + FMLLog.severe("A packet for channel %s for side %s was not processed by the embedded channel - it has been dropped. Payload\n%s", this.channel, this.target, ByteBufUtils.getContentDump(this.payload)); + } + internalChannel.inboundMessages().clear(); } catch (FMLNetworkException ne) {