diff --git a/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.json b/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.json index a4718cba..ef08b6f6 100644 --- a/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.json +++ b/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.json @@ -50,7 +50,7 @@ "idName": "updateTime", "name": "last update", "unit": "UnixTime", - "type": "uint", + "type": "int", "defaultValue": 0 }, { diff --git a/server/rest/restserver.cpp b/server/rest/restserver.cpp index e885b8e1..f3c99842 100644 --- a/server/rest/restserver.cpp +++ b/server/rest/restserver.cpp @@ -142,16 +142,21 @@ void RestServer::asyncReplyFinished() m_asyncReplies.remove(clientId); qCDebug(dcWebServer) << "Async reply finished"; - reply->setClientId(clientId); + // check if the reply timeouted if (reply->timedOut()) { reply->clear(); reply->setHttpStatusCode(HttpReply::GatewayTimeout); } - m_webserver->sendHttpReply(reply); + // check if client is still connected + if (!m_clientList.contains(clientId)) { + qCWarning(dcWebServer) << "Client for async reply not longer connected."; + } else { + reply->setClientId(clientId); + m_webserver->sendHttpReply(reply); + } reply->deleteLater(); } - }