fix(client): improve probe tracking and reply handling

This commit is contained in:
Nils Andreas Svee committed 2026-05-10 20:56:43 +07:00
1 parent 7cbc30a3a2
commit 548363ad05
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(())
}