mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-28 19:11:45 +01:00
fix: do not try to re-resize while at max packet buffer size
This commit is contained in:
parent
55bcfaa07b
commit
c96413678c
@ -202,6 +202,7 @@ public final class PacketWriting {
|
||||
if (written < minWrite) {
|
||||
// Try again with a bigger buffer
|
||||
final long newSize = Math.min(buffer.capacity() * 2, ServerFlag.MAX_PACKET_SIZE);
|
||||
if (newSize == buffer.capacity()) break; // We reached the maximum size
|
||||
buffer.resize(newSize);
|
||||
} else {
|
||||
// At least one packet has been written
|
||||
|
Loading…
Reference in New Issue
Block a user