mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-06-23 02:44:30 +10:00
Refactor timeout calculations for repeater and login frames to ensure minimum message size is respected; remove obsolete widget test file.
This commit is contained in:
@@ -91,9 +91,12 @@ class _RepeaterLoginDialogState extends State<RepeaterLoginDialog> {
|
||||
final selection = await _connector.preparePathForContactSend(repeater);
|
||||
final loginFrame = buildSendLoginFrame(repeater.publicKey, password);
|
||||
final pathLengthValue = selection.useFlood ? -1 : selection.hopCount;
|
||||
final responseBytes = loginFrame.length > maxFrameSize
|
||||
? loginFrame.length
|
||||
: maxFrameSize;
|
||||
final timeoutMs = _connector.calculateTimeout(
|
||||
pathLength: pathLengthValue,
|
||||
messageBytes: loginFrame.length,
|
||||
messageBytes: responseBytes,
|
||||
);
|
||||
final timeoutSeconds = (timeoutMs / 1000).ceil();
|
||||
final timeout = Duration(milliseconds: timeoutMs);
|
||||
|
||||
@@ -91,9 +91,12 @@ class _RoomLoginDialogState extends State<RoomLoginDialog> {
|
||||
final selection = await _connector.preparePathForContactSend(room);
|
||||
final loginFrame = buildSendLoginFrame(room.publicKey, password);
|
||||
final pathLengthValue = selection.useFlood ? -1 : selection.hopCount;
|
||||
final responseBytes = loginFrame.length > maxFrameSize
|
||||
? loginFrame.length
|
||||
: maxFrameSize;
|
||||
final timeoutMs = _connector.calculateTimeout(
|
||||
pathLength: pathLengthValue,
|
||||
messageBytes: loginFrame.length,
|
||||
messageBytes: responseBytes,
|
||||
);
|
||||
final timeoutSeconds = (timeoutMs / 1000).ceil();
|
||||
final timeout = Duration(milliseconds: timeoutMs);
|
||||
|
||||
Reference in New Issue
Block a user