diff options
-rw-r--r-- | client/SslClient.cpp | 5 | ||||
-rw-r--r-- | client/SslClient.h | 5 | ||||
-rw-r--r-- | client/UpdatedConfig.cpp | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/client/SslClient.cpp b/client/SslClient.cpp index 25165d2..698862a 100644 --- a/client/SslClient.cpp +++ b/client/SslClient.cpp @@ -156,6 +156,11 @@ void SslClient::DataRecieved() emit ReplyRecieved(type, data); } +void SslClient::Disconnect() +{ + sslSocket.close(); +} + void SslClient::Error(QAbstractSocket::SocketError e) { QString desc; diff --git a/client/SslClient.h b/client/SslClient.h index d31af70..24ccc94 100644 --- a/client/SslClient.h +++ b/client/SslClient.h @@ -98,6 +98,11 @@ public: * @param type type of request to send */ void SendRequest(RequestType type); + + /** + * @brief disconnect from server + */ + void Disconnect(); signals: /** * @brief This signal is emited when data is recieved as a reply to diff --git a/client/UpdatedConfig.cpp b/client/UpdatedConfig.cpp index f8b0fcb..bcd0cd7 100644 --- a/client/UpdatedConfig.cpp +++ b/client/UpdatedConfig.cpp @@ -98,7 +98,7 @@ void UpdatedConfig::gotServerReply(SslClient::RequestType &type, QByteArray &con goto end; } - //Logger::Debug("data: %s\n", confdata.constData()); + Logger::Debug("data: %s\n", confdata.constData()); /* stop timer - working server found */ configUpdateTimer->stop(); @@ -135,6 +135,7 @@ end: else { Logger::Info("Config successfully updated!\n"); + client->Disconnect(); /* reset retry params and setup timer to fire on next planned update */ time = 0; |