Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-06 00:00:47 +01:00
Close one last "proxy crasher" loophole
Dieser Commit ist enthalten in:
Ursprung
5d3479aae5
Commit
558c158592
@ -145,7 +145,7 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.pipeline().addBefore(MINECRAFT_DECODER, "discard", DiscardHandler.HANDLER);
|
installDiscardHandler(ctx);
|
||||||
ctx.close();
|
ctx.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -161,6 +161,14 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
|
|||||||
Preconditions.checkState(this.channel.eventLoop().inEventLoop(), "Not in event loop");
|
Preconditions.checkState(this.channel.eventLoop().inEventLoop(), "Not in event loop");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void installDiscardHandler(ChannelHandlerContext ctx) {
|
||||||
|
ctx.pipeline().addBefore(MINECRAFT_DECODER, "discard", DiscardHandler.HANDLER);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void installDiscardHandler() {
|
||||||
|
channel.pipeline().addBefore(MINECRAFT_DECODER, "discard", DiscardHandler.HANDLER);
|
||||||
|
}
|
||||||
|
|
||||||
public EventLoop eventLoop() {
|
public EventLoop eventLoop() {
|
||||||
return channel.eventLoop();
|
return channel.eventLoop();
|
||||||
}
|
}
|
||||||
@ -201,6 +209,7 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
|
|||||||
public void closeWith(Object msg) {
|
public void closeWith(Object msg) {
|
||||||
if (channel.isActive()) {
|
if (channel.isActive()) {
|
||||||
knownDisconnect = true;
|
knownDisconnect = true;
|
||||||
|
installDiscardHandler();
|
||||||
channel.writeAndFlush(msg).addListener(ChannelFutureListener.CLOSE);
|
channel.writeAndFlush(msg).addListener(ChannelFutureListener.CLOSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -210,6 +219,7 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
|
|||||||
*/
|
*/
|
||||||
public void close() {
|
public void close() {
|
||||||
if (channel.isActive()) {
|
if (channel.isActive()) {
|
||||||
|
installDiscardHandler();
|
||||||
channel.close();
|
channel.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren