Don't attempt to read packets after channel is closed/closing

This commit is contained in:
Outfluencer 2025-03-03 19:58:46 +11:00 committed by md_5
parent 362bd0f4c4
commit 458246505f
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -130,6 +130,11 @@ public class ChannelWrapper
{
if ( !closed )
{
if ( !closing )
{
ch.config().setAutoRead( false );
}
closed = closing = true;
if ( packet != null && ch.isActive() )
@ -148,6 +153,7 @@ public class ChannelWrapper
if ( !closing )
{
closing = true;
ch.config().setAutoRead( false );
// Minecraft client can take some time to switch protocols.
// Sending the wrong disconnect packet whilst a protocol switch is in progress will crash it.