Skip to content

Commit

Permalink
use fetch_min
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyRosenblum committed Oct 2, 2024
1 parent ac3b2e5 commit 5c4125f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions dc/s2n-quic-dc/src/path/secret/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,9 @@ impl Entry {
rehandshake_time: Duration,
) -> Self {
// clamp max datagram size to a well-known value
let max_datagram_size = parameters.max_datagram_size.load(Ordering::Relaxed);
parameters.max_datagram_size.store(
max_datagram_size.min(crate::stream::MAX_DATAGRAM_SIZE as _),
Ordering::Relaxed,
);
parameters
.max_datagram_size
.fetch_min(crate::stream::MAX_DATAGRAM_SIZE as _, Ordering::Relaxed);

assert!(rehandshake_time.as_secs() <= u32::MAX as u64);
Self {
Expand Down

0 comments on commit 5c4125f

Please sign in to comment.