mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-20 02:04:07 +00:00
Discard retry token when no longer needed
This commit is contained in:
committed by
Dirkjan Ochtman
parent
5375279f5a
commit
6fc46aefc6
@@ -178,7 +178,8 @@ pub struct Connection {
|
||||
authentication_failures: u64,
|
||||
/// Why the connection was lost, if it has been
|
||||
error: Option<ConnectionError>,
|
||||
/// Sent in every outgoing Initial packet. Always empty for servers.
|
||||
/// Sent in every outgoing Initial packet. Always empty for servers and after Initial keys are
|
||||
/// discarded.
|
||||
retry_token: Bytes,
|
||||
|
||||
//
|
||||
@@ -1776,6 +1777,10 @@ impl Connection {
|
||||
fn discard_space(&mut self, now: Instant, space_id: SpaceId) {
|
||||
debug_assert!(space_id != SpaceId::Data);
|
||||
trace!("discarding {:?} keys", space_id);
|
||||
if space_id == SpaceId::Initial {
|
||||
// No longer needed
|
||||
self.retry_token = Bytes::new();
|
||||
}
|
||||
let space = &mut self.spaces[space_id];
|
||||
space.crypto = None;
|
||||
space.time_of_last_ack_eliciting_packet = None;
|
||||
|
||||
Reference in New Issue
Block a user