diff --git a/lib/backend/api.dart b/lib/backend/api.dart index 0be7e66..c43766e 100644 --- a/lib/backend/api.dart +++ b/lib/backend/api.dart @@ -586,6 +586,7 @@ class Api { void _startPinging() { _pingTimer?.cancel(); + sendPing(interactive: !KometSettings.ghostMode.value); _pingTimer = Timer.periodic(ServerConfig.pingInterval, (_) { sendPing(interactive: !KometSettings.ghostMode.value); }); diff --git a/lib/core/protocol/packet.dart b/lib/core/protocol/packet.dart index c99c138..565b339 100644 --- a/lib/core/protocol/packet.dart +++ b/lib/core/protocol/packet.dart @@ -7,7 +7,9 @@ import 'lz4_block.dart'; /// ver(1) + cmd(1) + seq(2) + opcode(2) + packedLen(4) = 10 const int headerSize = 10; -const int _maxDecompressedSize = 1048576; // 1 MB + +/// Потолок распаковки payload (анти-бомба); буфер растёт динамически до него. +const int _maxDecompressedSize = 32 * 1024 * 1024; // 32 MB /// Типы команд в протоколе abstract class CmdType { diff --git a/lib/core/transport/receiver.dart b/lib/core/transport/receiver.dart index 1fcd198..4113e4f 100644 --- a/lib/core/transport/receiver.dart +++ b/lib/core/transport/receiver.dart @@ -14,7 +14,7 @@ class PacketReceiver { int _start = 0; int _end = 0; - static const int _maxBufferSize = 2 * 1024 * 1024; + static const int _maxBufferSize = 16 * 1024 * 1024; List feed(Uint8List data) { _append(data);