fix(client): improve probe tracking and reply handling
This commit is contained in:
1 parent
7cbc30a3a2
commit
548363ad05
2 files changed
+19
-6
No files matched your search
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user