Skip to content

Commit

Permalink
Close listen sockets before initiating disconnect on quit
Browse files Browse the repository at this point in the history
This fixes clients reconnecting while we're shutting down. This mostly
just prevents unclear (SSL) errors on the client side.
  • Loading branch information
halfgaar committed Nov 20, 2024
1 parent 62bcd11 commit 8c76868
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mainapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,8 @@ void MainApp::start()
}
}

activeListenSockets.clear();

this->bgWorker.stop();

if (settings.willsEnabled)
Expand Down
1 change: 1 addition & 0 deletions scopedsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ScopedSocket::~ScopedSocket()
{
if (socket >= 0)
close(socket);
socket = -1;
listener.reset();
}

Expand Down

0 comments on commit 8c76868

Please sign in to comment.