Skip to content

Commit be06a46

Browse files
Merge pull request #311 from expressvpn/cvpn-2310-fix-ping-handler
core: check for online status in pong handler
2 parents 7c9eec9 + ba6e05b commit be06a46

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lightway-core/src/connection.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,11 @@ impl<AppState: Send> Connection<AppState> {
13531353
}
13541354

13551355
fn handle_pong(&mut self, pong: wire::Pong) -> ConnectionResult<()> {
1356-
info!(id = pong.id, "Received pong");
1356+
if !matches!(self.state, State::Online) {
1357+
return Err(ConnectionError::InvalidState);
1358+
}
1359+
1360+
debug!(id = pong.id, "Received pong");
13571361
if pong.id == 0 {
13581362
self.event(Event::KeepaliveReply);
13591363
}

0 commit comments

Comments
 (0)