Update core modules and add GUI panels

This commit is contained in:
2026-06-08 17:32:42 +08:00
parent 2d33b4b2ae
commit 2eb02350da
23 changed files with 822 additions and 161 deletions

View File

@@ -1,4 +1,5 @@
use super::{Endian, Framer};
use tracing::{debug, warn};
/// Configuration for the length-prefixed framer.
#[derive(Debug, Clone)]
@@ -96,6 +97,11 @@ impl Framer for LengthPrefixedFramer {
// Discard length, re-sync on corrupt frame
if self.config.max_payload > 0 && payload_len > self.config.max_payload {
warn!(
claimed = payload_len,
max = self.config.max_payload,
"corrupt length frame, skipping"
);
self.buf.drain(..self.config.len_bytes);
continue;
}
@@ -115,6 +121,7 @@ impl Framer for LengthPrefixedFramer {
break;
}
let frame: Vec<u8> = self.buf.drain(..expected).collect();
debug!(len = frame.len(), "length-prefixed frame extracted");
frames.push(frame);
self.state = State::ReadingLength;
}