stop all path timers when all path data is dropped

This commit is contained in:
Floris Bruynooghe
2025-11-22 16:30:31 +01:00
parent 2e13da69ec
commit e3172987ef
2 changed files with 10 additions and 5 deletions
+1 -5
View File
@@ -1855,11 +1855,6 @@ impl Connection {
};
path.challenges_sent.clear();
path.challenge_pending = false;
// TODO(flub): not sure yet
self.timers
.stop(Timer::PerPath(path_id, PathTimer::LossDetection));
debug!("new path validation failed");
if let Err(err) = self.close_path(
now,
@@ -1886,6 +1881,7 @@ impl Connection {
PathTimer::PathAbandoned => {
// The path was abandoned and 3*PTO has expired since. Clean up all
// remaining state and install stateless reset token.
self.timers.stop_per_path(path_id);
if let Some(loc_cid_state) = self.local_cid_state.remove(&path_id) {
let (min_seq, max_seq) = loc_cid_state.active_seq();
for seq in min_seq..=max_seq {
+9
View File
@@ -278,6 +278,15 @@ impl TimerTable {
}
}
/// Stops all per-path timers
pub(super) fn stop_per_path(&mut self, path_id: PathId) {
for timer in PathTimer::VALUES {
if let Some(e) = self.path_timers.get_mut(&path_id) {
e.stop(timer);
}
}
}
/// Get the next queued timeout
pub(super) fn peek(&mut self) -> Option<Instant> {
// TODO: this is currently linear in the number of paths