From 10b5d77ef68561f535e8b45a32228bf5d122dd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 21 Sep 2015 22:56:26 +0200 Subject: [PATCH] fix timout --- libguh/network/upnpdiscovery/upnpdiscovery.cpp | 7 +++---- server/httpreply.cpp | 2 +- server/rest/devicesresource.h | 1 - server/rest/restserver.cpp | 3 +++ 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libguh/network/upnpdiscovery/upnpdiscovery.cpp b/libguh/network/upnpdiscovery/upnpdiscovery.cpp index 79841cad..77bf32c4 100644 --- a/libguh/network/upnpdiscovery/upnpdiscovery.cpp +++ b/libguh/network/upnpdiscovery/upnpdiscovery.cpp @@ -84,7 +84,7 @@ UpnpDiscovery::UpnpDiscovery(QObject *parent) : connect(this, &UpnpDiscovery::readyRead, this, &UpnpDiscovery::readData); m_notificationTimer = new QTimer(this); - m_notificationTimer->setInterval(3000); + m_notificationTimer->setInterval(30000); m_notificationTimer->setSingleShot(false); connect(m_notificationTimer, &QTimer::timeout, this, &UpnpDiscovery::notificationTimeout); @@ -196,8 +196,8 @@ void UpnpDiscovery::readData() } if (data.contains("M-SEARCH")) { - qCDebug(dcHardware) << "--------------------------------------"; - qCDebug(dcHardware) << QString("UPnP data: %1:%2 \n").arg(hostAddress.toString()).arg(QString::number(port)) << data; + //qCDebug(dcHardware) << "--------------------------------------"; + //qCDebug(dcHardware) << QString("UPnP data: %1:%2 \n").arg(hostAddress.toString()).arg(QString::number(port)) << data; respondToSearchRequest(hostAddress, port); return; } @@ -351,7 +351,6 @@ void UpnpDiscovery::notificationTimeout() } } } - } void UpnpDiscovery::discoverTimeout() diff --git a/server/httpreply.cpp b/server/httpreply.cpp index e5122635..051084a4 100644 --- a/server/httpreply.cpp +++ b/server/httpreply.cpp @@ -390,7 +390,7 @@ QByteArray HttpReply::getHeaderType(const HttpReply::HttpHeaderType &headerType) */ void HttpReply::startWait() { - m_timer->start(5000); + m_timer->start(10000); } void HttpReply::timeout() diff --git a/server/rest/devicesresource.h b/server/rest/devicesresource.h index 44d2c860..5b12d112 100644 --- a/server/rest/devicesresource.h +++ b/server/rest/devicesresource.h @@ -80,7 +80,6 @@ private slots: void deviceSetupFinished(Device *device, DeviceManager::DeviceError status); void deviceEditFinished(Device *device, DeviceManager::DeviceError status); void pairingFinished(const PairingTransactionId &pairingTransactionId, DeviceManager::DeviceError status, const DeviceId &deviceId); - }; } diff --git a/server/rest/restserver.cpp b/server/rest/restserver.cpp index b4be601e..e885b8e1 100644 --- a/server/rest/restserver.cpp +++ b/server/rest/restserver.cpp @@ -138,8 +138,11 @@ void RestServer::processHttpRequest(const QUuid &clientId, const HttpRequest &re void RestServer::asyncReplyFinished() { HttpReply *reply = qobject_cast(sender()); + QUuid clientId = m_asyncReplies.key(reply); + m_asyncReplies.remove(clientId); qCDebug(dcWebServer) << "Async reply finished"; + reply->setClientId(clientId); if (reply->timedOut()) { reply->clear();