mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-30 12:01:26 +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) {
|
if (written < minWrite) {
|
||||||
// Try again with a bigger buffer
|
// Try again with a bigger buffer
|
||||||
final long newSize = Math.min(buffer.capacity() * 2, ServerFlag.MAX_PACKET_SIZE);
|
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);
|
buffer.resize(newSize);
|
||||||
} else {
|
} else {
|
||||||
// At least one packet has been written
|
// At least one packet has been written
|
||||||
|
Loading…
Reference in New Issue
Block a user