fix(client): improve probe tracking and reply handling

This commit is contained in:
Nils Andreas Svee committed 2026-04-28 21:55:49 +07:00
1 parent 2380d76da3
commit 3534a59fce
2 files changed
+19 -6

No files matched your search

+6 -1
View File
@@ -24,12 +24,17 @@ impl PendingMap {
}
}
pub fn insert(&mut self, probe: PendingProbe) -> Result<(), ClientError> {
pub fn check_capacity(&self) -> Result<(), ClientError> {
if self.map.len() >= self.max_capacity {
return Err(ClientError::PendingLimitExceeded {
limit: self.max_capacity,
});
}
Ok(())
}
pub fn insert(&mut self, probe: PendingProbe) -> Result<(), ClientError> {
self.check_capacity()?;
self.map.insert(probe.wire_seq, probe);
Ok(())
}