From 52ae735ea32911ab4e3e145999a6408072bf663e Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 2 Sep 2024 20:47:01 -0400 Subject: [PATCH] Change `LoginInboundConnection` queue type to something that is actually thread-safe --- .../proxy/connection/client/LoginInboundConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginInboundConnection.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginInboundConnection.java index 93064a790..837376f95 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginInboundConnection.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginInboundConnection.java @@ -30,9 +30,9 @@ import io.netty.buffer.ByteBufUtil; import io.netty.buffer.Unpooled; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import java.net.InetSocketAddress; -import java.util.ArrayDeque; import java.util.Optional; import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; import net.kyori.adventure.text.Component; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; @@ -58,7 +58,7 @@ public class LoginInboundConnection implements LoginPhaseConnection, KeyIdentifi InitialInboundConnection delegate) { this.delegate = delegate; this.outstandingResponses = Int2ObjectSyncMap.hashmap(); - this.loginMessagesToSend = new ArrayDeque<>(); + this.loginMessagesToSend = new ConcurrentLinkedQueue<>(); } @Override