Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ignoring empty packets the default behavior vs hiding it behind a configuration option, allowing such packets is less harmful than the current handling of them
- Loading branch information
1 parent
420f783
commit 2b3b0ec
Showing
11 changed files
with
77 additions
and
209 deletions.
There are no files selected for viewing
111 changes: 0 additions & 111 deletions
111
BungeeCord-Patches/0045-Add-Configuration-to-allow-empty-packets.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
From dc105ad9e7123923267007948e8323c5623ed7df Mon Sep 17 00:00:00 2001 | ||
From: Shane Freeder <theboyetronic@gmail.com> | ||
Date: Fri, 12 Oct 2018 14:28:52 +0100 | ||
Subject: [PATCH] Ignore empty packets | ||
|
||
This patch puts the proxy more inline with the client in that empty | ||
packets will be ignored. While empty packets are a sign of bad plugins, | ||
they are effectivly harmless vs the cost of the exception in general | ||
|
||
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java | ||
index 9e9ea49c..71ddf022 100644 | ||
--- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java | ||
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java | ||
@@ -36,6 +36,12 @@ public class MinecraftDecoder extends MessageToMessageDecoder<ByteBuf> | ||
Object packetTypeInfo = null; | ||
try | ||
{ | ||
+ // Waterfall start | ||
+ if (in.readableBytes() == 0) { | ||
+ return; | ||
+ } | ||
+ // Waterfall end | ||
+ | ||
int packetId = DefinedPacket.readVarInt( in ); | ||
packetTypeInfo = packetId; | ||
|
||
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java | ||
index e903fd09..25ee2027 100644 | ||
--- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java | ||
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java | ||
@@ -30,7 +30,7 @@ public class Varint21FrameDecoder extends ByteToMessageDecoder | ||
if ( buf[i] >= 0 ) | ||
{ | ||
int length = DefinedPacket.readVarInt( Unpooled.wrappedBuffer( buf ) ); | ||
- if ( length == 0 ) | ||
+ if ( false && length == 0) // Waterfall - ignore | ||
{ | ||
throw new CorruptedFrameException( "Empty Packet!" ); | ||
} | ||
-- | ||
2.23.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 0 additions & 63 deletions
63
BungeeCord-Patches/0048-Handle-empty-minecraft-packets.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.