Don't attempt to read packets after channel is closed/closing
This commit is contained in:
parent
362bd0f4c4
commit
458246505f
@ -130,6 +130,11 @@ public class ChannelWrapper
|
|||||||
{
|
{
|
||||||
if ( !closed )
|
if ( !closed )
|
||||||
{
|
{
|
||||||
|
if ( !closing )
|
||||||
|
{
|
||||||
|
ch.config().setAutoRead( false );
|
||||||
|
}
|
||||||
|
|
||||||
closed = closing = true;
|
closed = closing = true;
|
||||||
|
|
||||||
if ( packet != null && ch.isActive() )
|
if ( packet != null && ch.isActive() )
|
||||||
@ -148,6 +153,7 @@ public class ChannelWrapper
|
|||||||
if ( !closing )
|
if ( !closing )
|
||||||
{
|
{
|
||||||
closing = true;
|
closing = true;
|
||||||
|
ch.config().setAutoRead( false );
|
||||||
|
|
||||||
// Minecraft client can take some time to switch protocols.
|
// Minecraft client can take some time to switch protocols.
|
||||||
// Sending the wrong disconnect packet whilst a protocol switch is in progress will crash it.
|
// Sending the wrong disconnect packet whilst a protocol switch is in progress will crash it.
|
||||||
|
Loading…
Reference in New Issue
Block a user