fix timout
This commit is contained in:
parent
0fb45733dc
commit
10b5d77ef6
@ -84,7 +84,7 @@ UpnpDiscovery::UpnpDiscovery(QObject *parent) :
|
|||||||
connect(this, &UpnpDiscovery::readyRead, this, &UpnpDiscovery::readData);
|
connect(this, &UpnpDiscovery::readyRead, this, &UpnpDiscovery::readData);
|
||||||
|
|
||||||
m_notificationTimer = new QTimer(this);
|
m_notificationTimer = new QTimer(this);
|
||||||
m_notificationTimer->setInterval(3000);
|
m_notificationTimer->setInterval(30000);
|
||||||
m_notificationTimer->setSingleShot(false);
|
m_notificationTimer->setSingleShot(false);
|
||||||
|
|
||||||
connect(m_notificationTimer, &QTimer::timeout, this, &UpnpDiscovery::notificationTimeout);
|
connect(m_notificationTimer, &QTimer::timeout, this, &UpnpDiscovery::notificationTimeout);
|
||||||
@ -196,8 +196,8 @@ void UpnpDiscovery::readData()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data.contains("M-SEARCH")) {
|
if (data.contains("M-SEARCH")) {
|
||||||
qCDebug(dcHardware) << "--------------------------------------";
|
//qCDebug(dcHardware) << "--------------------------------------";
|
||||||
qCDebug(dcHardware) << QString("UPnP data: %1:%2 \n").arg(hostAddress.toString()).arg(QString::number(port)) << data;
|
//qCDebug(dcHardware) << QString("UPnP data: %1:%2 \n").arg(hostAddress.toString()).arg(QString::number(port)) << data;
|
||||||
respondToSearchRequest(hostAddress, port);
|
respondToSearchRequest(hostAddress, port);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -351,7 +351,6 @@ void UpnpDiscovery::notificationTimeout()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpnpDiscovery::discoverTimeout()
|
void UpnpDiscovery::discoverTimeout()
|
||||||
|
|||||||
@ -390,7 +390,7 @@ QByteArray HttpReply::getHeaderType(const HttpReply::HttpHeaderType &headerType)
|
|||||||
*/
|
*/
|
||||||
void HttpReply::startWait()
|
void HttpReply::startWait()
|
||||||
{
|
{
|
||||||
m_timer->start(5000);
|
m_timer->start(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HttpReply::timeout()
|
void HttpReply::timeout()
|
||||||
|
|||||||
@ -80,7 +80,6 @@ private slots:
|
|||||||
void deviceSetupFinished(Device *device, DeviceManager::DeviceError status);
|
void deviceSetupFinished(Device *device, DeviceManager::DeviceError status);
|
||||||
void deviceEditFinished(Device *device, DeviceManager::DeviceError status);
|
void deviceEditFinished(Device *device, DeviceManager::DeviceError status);
|
||||||
void pairingFinished(const PairingTransactionId &pairingTransactionId, DeviceManager::DeviceError status, const DeviceId &deviceId);
|
void pairingFinished(const PairingTransactionId &pairingTransactionId, DeviceManager::DeviceError status, const DeviceId &deviceId);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,8 +138,11 @@ void RestServer::processHttpRequest(const QUuid &clientId, const HttpRequest &re
|
|||||||
void RestServer::asyncReplyFinished()
|
void RestServer::asyncReplyFinished()
|
||||||
{
|
{
|
||||||
HttpReply *reply = qobject_cast<HttpReply*>(sender());
|
HttpReply *reply = qobject_cast<HttpReply*>(sender());
|
||||||
|
QUuid clientId = m_asyncReplies.key(reply);
|
||||||
|
m_asyncReplies.remove(clientId);
|
||||||
|
|
||||||
qCDebug(dcWebServer) << "Async reply finished";
|
qCDebug(dcWebServer) << "Async reply finished";
|
||||||
|
reply->setClientId(clientId);
|
||||||
|
|
||||||
if (reply->timedOut()) {
|
if (reply->timedOut()) {
|
||||||
reply->clear();
|
reply->clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user