Skip to content

Commit

Permalink
Fix for Bug #36731.
Browse files Browse the repository at this point in the history
Add CloseActiveConnections() call in TCPBase::Close(), which
is called as part of Server::Shutdown().
Active connections should be closed as part of Server shutdown.
This allows the TCPConnectionState to also close the associated
TCPEndpoint object as part of this shutdown flow.

Previously, the CloseActiveConnections() call was present in the
TCPBase destructor alone.
  • Loading branch information
pidarped committed Dec 18, 2024
1 parent 2c6c421 commit 361adab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/transport/raw/ActiveTCPConnectionState.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ struct ActiveTCPConnectionState

void Free()
{
mEndPoint->Free();
if (mEndPoint)
{
mEndPoint->Free();
}
mPeerAddr = PeerAddress::Uninitialized();
mEndPoint = nullptr;
mReceived = nullptr;
Expand Down
3 changes: 3 additions & 0 deletions src/transport/raw/TCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ void TCPBase::Close()
mListenSocket->Free();
mListenSocket = nullptr;
}

CloseActiveConnections();

mState = TCPState::kNotReady;
}

Expand Down

0 comments on commit 361adab

Please sign in to comment.