Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions libwebauthn/src/transport/cable/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ impl CableChannel {
return Ok(());
}

// If already terminated, return error immediately
// If already terminated, return error immediately. Mirror the
// post-`changed()` branch below so that an early-terminated channel
// surfaces the same variant as one that terminates while we wait;
// the caller can't observe the timing difference and the asymmetry
// was accidental.
if *rx.borrow() == ConnectionState::Terminated {
return Err(Error::Transport(TransportError::ConnectionLost));
return Err(Error::Transport(TransportError::ConnectionFailed));
}

// Wait for state change
Expand Down
Loading