From ab750adc8c98bc33784498b4d06c36798f52ff4b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 21 Jul 2015 18:47:22 +0200 Subject: Immediately close the socket after a shutdown notification. Otherwise it can happen that the synchronizer receives the shutdown command from a ResourceAccess instance, and while the synchronizer waits for quit to be called, a new ResourceAccess instance already connects to the synchronizer. That new connection will then of course be unexpectedly killed once quit is called in the synchronizer. --- synchronizer/listener.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'synchronizer') diff --git a/synchronizer/listener.cpp b/synchronizer/listener.cpp index 6c07809..1050da3 100644 --- a/synchronizer/listener.cpp +++ b/synchronizer/listener.cpp @@ -255,6 +255,8 @@ void Listener::processCommand(int commandId, uint messageId, const QByteArray &c break; case Akonadi2::Commands::ShutdownCommand: Log() << QString("\tReceived shutdown command from %1").arg(client.name); + //Immediately reject new connections + m_server->close(); QTimer::singleShot(0, this, &Listener::quit); break; default: @@ -285,7 +287,7 @@ void Listener::quit() } m_fbb.Clear(); - m_server->close(); + //Connections will be cleaned up later emit noClients(); } -- cgit v1.2.3