Waterfall/BungeeCord-Patches/0055-Add-the-ability-to-generate-decoder-traces-for-debug.patch
Shane Freeder f49e238640
Updated Upstream (BungeeCord)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
5e7dcc48 #3382: Use the correct write method for ChatChain in ClientChat packet
5cdba87b #3377: Add additional checks for protocol length limits
2022-08-20 17:43:03 +01:00

45 lines
1.5 KiB
Diff

From b6366cee1ab16d0c0ec04efd433f12e118206ad0 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 15 Sep 2020 18:11:49 +0100
Subject: [PATCH] Add the ability to generate decoder traces for debugging
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java b/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java
index 2583aa2c..334d5054 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java
@@ -4,6 +4,7 @@ import io.netty.handler.codec.DecoderException;
public class FastDecoderException extends DecoderException {
+ private static final boolean PROCESS_TRACES = Boolean.getBoolean("waterfall.decoder-traces"); // Waterfall
public FastDecoderException(String message, Throwable cause) {
super(message, cause);
}
@@ -15,12 +16,22 @@ public class FastDecoderException extends DecoderException {
@Override
public Throwable initCause(Throwable cause)
{
+ // Waterfall start
+ if (PROCESS_TRACES) {
+ return super.initCause(cause);
+ }
+ // Waterfall end
return this;
}
@Override
public Throwable fillInStackTrace()
{
+ // Waterfall start
+ if (PROCESS_TRACES) {
+ return super.fillInStackTrace();
+ }
+ // Waterfall end
return this;
}
}
--
2.37.2