From 57880c54bc2503ef6d983a4bd2291ee8a45c263a Mon Sep 17 00:00:00 2001 From: aromaa Date: Sun, 17 Dec 2023 23:54:49 +0200 Subject: [PATCH] Fix Connection#isConnected race Regression from 1fdc9ef. This is a Netty thing so not much can be done. Could effect other places that only check for channel#isOpen or theoretically mods but fixing the deadlock is more important. --- .../common/mixin/core/network/ConnectionMixin.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/network/ConnectionMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/network/ConnectionMixin.java index a7f3d635983..e9b9c3bce00 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/network/ConnectionMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/network/ConnectionMixin.java @@ -44,6 +44,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.common.SpongeMinecraftVersion; import org.spongepowered.common.accessor.network.Connection_PacketHolderAccessor; import org.spongepowered.common.bridge.network.ConnectionBridge; @@ -80,6 +81,8 @@ public abstract class ConnectionMixin extends SimpleChannelInboundHandler cir) { + if (this.impl$disconnected) { + cir.setReturnValue(false); + } } }