fix(client): handle close-flagged echo replies

This commit is contained in:
Nils Andreas Svee committed 2026-05-10 20:56:43 +07:00
1 parent 48f6cb80ed
commit a41a1e319d
3 files changed
+119 -3

No files matched your search

+12 -1
View File
@@ -80,13 +80,24 @@ pub(super) fn echo_reply_packet(
params: &Params,
timestamps: &TimestampFields,
hmac_key: Option<&[u8]>,
) -> Vec<u8> {
echo_reply_packet_with_flags(token, seq, params, timestamps, hmac_key, FLAG_REPLY)
}
pub(super) fn echo_reply_packet_with_flags(
token: u64,
seq: u32,
params: &Params,
timestamps: &TimestampFields,
hmac_key: Option<&[u8]>,
flags: u8,
) -> Vec<u8> {
let has_hmac = hmac_key.is_some();
let layout = PacketLayout::echo(has_hmac, params);
let packet_len = echo_packet_len(has_hmac, params);
let mut packet = Vec::with_capacity(packet_len);
let mut flags = FLAG_REPLY;
let mut flags = flags;
if has_hmac {
flags |= FLAG_HMAC;
}