Mirror von
https://github.com/Moulberry/AxiomPaperPlugin.git
synchronisiert 2024-11-17 05:40:06 +01:00
Don't process inactive channel + skip remaining bytes
Dieser Commit ist enthalten in:
Ursprung
93c618a150
Commit
1140204157
@ -25,7 +25,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
paperweight.paperDevBundle("1.20.2-R0.1-20231010.011415-29")
|
||||
paperweight.paperDevBundle("1.20.2-R0.1-SNAPSHOT")
|
||||
implementation("xyz.jpenilla:reflection-remapper:0.1.0-SNAPSHOT")
|
||||
|
||||
// Zstd Compression Library
|
||||
|
@ -26,6 +26,12 @@ public class AxiomBigPayloadHandler extends ByteToMessageDecoder {
|
||||
|
||||
@Override
|
||||
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
|
||||
// Don't process if channel isn't active
|
||||
if (!ctx.channel().isActive()) {
|
||||
in.skipBytes(in.readableBytes());
|
||||
return;
|
||||
}
|
||||
|
||||
int i = in.readableBytes();
|
||||
if (i != 0) {
|
||||
int readerIndex = in.readerIndex();
|
||||
@ -55,6 +61,11 @@ public class AxiomBigPayloadHandler extends ByteToMessageDecoder {
|
||||
}
|
||||
|
||||
ctx.fireChannelRead(in.retain());
|
||||
|
||||
// Skip remaining bytes
|
||||
if (in.readableBytes() > 0) {
|
||||
in.skipBytes(in.readableBytes());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren