mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
- Fixed a mutex lock in UPnP code
This commit is contained in:
parent
fc10f3c4cd
commit
04a716ac91
@ -1033,7 +1033,9 @@ m_UPnPPort(udpPort)
|
|||||||
// Lock it again, so that we block. Unlocking will only happen
|
// Lock it again, so that we block. Unlocking will only happen
|
||||||
// when the UPNP_DISCOVERY_SEARCH_TIMEOUT event occurs at the
|
// when the UPNP_DISCOVERY_SEARCH_TIMEOUT event occurs at the
|
||||||
// callback.
|
// callback.
|
||||||
QMutexLocker lock(&m_WaitForSearchTimeout);
|
searchTimeoutCondition.wait(&m_WaitForSearchTimeout);
|
||||||
|
// QMutexLocker lock(&m_WaitForSearchTimeout);s
|
||||||
|
m_WaitForSearchTimeout.unlock();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1364,7 +1366,8 @@ upnpDiscovery:
|
|||||||
qDebug("UPnP: %s", msg.str().c_str());
|
qDebug("UPnP: %s", msg.str().c_str());
|
||||||
|
|
||||||
// Unlock the search timeout mutex
|
// Unlock the search timeout mutex
|
||||||
upnpCP->m_WaitForSearchTimeout.unlock();
|
// upnpCP->m_WaitForSearchTimeout.unlock();
|
||||||
|
upnpCP->searchTimeoutCondition.wakeOne();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
extern std::string stdEmptyString;
|
extern std::string stdEmptyString;
|
||||||
#endif // UPNP_C
|
#endif // UPNP_C
|
||||||
|
|
||||||
|
#include <QWaitCondition>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case insensitive std::string comparison
|
* Case insensitive std::string comparison
|
||||||
@ -640,6 +641,7 @@ private:
|
|||||||
bool m_IGWDeviceDetected;
|
bool m_IGWDeviceDetected;
|
||||||
CUPnPService *m_WanService;
|
CUPnPService *m_WanService;
|
||||||
QMutex m_WaitForSearchTimeout;
|
QMutex m_WaitForSearchTimeout;
|
||||||
|
QWaitCondition searchTimeoutCondition;
|
||||||
unsigned short m_UPnPPort;
|
unsigned short m_UPnPPort;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user