Skip to content

Commit

Permalink
Correctly handle closing a dropped socket in FinWait1 state
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasKoch committed Feb 3, 2024
1 parent 6ad40f5 commit 8ab1612
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/asynch/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ impl<
}
DisconnectReason::SecurityProblems => {
error!("Wifi Security Problems");
con.wifi_state = WiFiState::NotConnected;
}
_ => {
con.wifi_state = WiFiState::NotConnected;
Expand Down
5 changes: 4 additions & 1 deletion src/asynch/ublox_stack/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,10 @@ impl<'a> TcpSocket<'a> {

impl<'a> Drop for TcpSocket<'a> {
fn drop(&mut self) {
if matches!(self.state(), TcpState::Listen | TcpState::Established) {
if matches!(
self.state(),
TcpState::Listen | TcpState::Established | TcpState::FinWait1
) {
if let Some(peer_handle) = self.io.with(|s| s.peer_handle) {
self.io
.stack
Expand Down

0 comments on commit 8ab1612

Please sign in to comment.