summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/remoteserverconnection.cpp
diff options
context:
space:
mode:
authorkh <karsten.heimrich@theqtcompany.com>2014-11-27 14:00:32 +0100
committerKai Koehne <kai.koehne@theqtcompany.com>2014-12-02 13:28:52 +0100
commit2e05d089af226f798cbae3f44ff9d131bf682024 (patch)
tree27611e626476ecc70a4427a4ab212114cf0db7ed /src/libs/installer/remoteserverconnection.cpp
parent5e4f49fd4edbffc302bd14b972f6ea046230a333 (diff)
Refine server starting/stopping code.
If we can't connect, the server is most likely not running. Also send an acknowledgment that we are going to shutdown. Change-Id: I1a06b0ea5b5bdeb736042ca8b49508b6a4fd90b8 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/remoteserverconnection.cpp')
-rw-r--r--src/libs/installer/remoteserverconnection.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libs/installer/remoteserverconnection.cpp b/src/libs/installer/remoteserverconnection.cpp
index fbb51641c..0a142c4be 100644
--- a/src/libs/installer/remoteserverconnection.cpp
+++ b/src/libs/installer/remoteserverconnection.cpp
@@ -74,15 +74,17 @@ void RemoteServerConnection::run()
stream >> command;
if (authorized && command == QLatin1String(Protocol::Shutdown)) {
- // this is a graceful shutdown
- socket.close();
authorized = false;
+ sendData(stream, true);
+ socket.flush();
+ socket.close();
emit shutdownRequested();
return;
} else if (command == QLatin1String(Protocol::Authorize)) {
QString key;
stream >> key;
sendData(stream, (authorized = (key == m_authorizationKey)));
+ socket.flush();
if (!authorized)
socket.close();
} else if (authorized) {