mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 16:07:23 -06:00
Fix exceptions on Windows XP when IPv6 is disabled (Thanks paolo zambotti)
This commit is contained in:
@@ -60,7 +60,9 @@ public:
|
||||
}
|
||||
|
||||
QString getHostFromCache(const libtorrent::asio::ip::tcp::endpoint &ip) {
|
||||
const QString ip_str = misc::toQString(ip.address().to_string());
|
||||
boost::system::error_code ec;
|
||||
const QString ip_str = misc::toQString(ip.address().to_string(ec));
|
||||
if (ec) return QString();
|
||||
QString ret;
|
||||
if(m_cache.contains(ip_str)) {
|
||||
qDebug("Got host name from cache");
|
||||
@@ -72,7 +74,9 @@ public:
|
||||
}
|
||||
|
||||
void resolve(const libtorrent::asio::ip::tcp::endpoint &ip) {
|
||||
const QString ip_str = misc::toQString(ip.address().to_string());
|
||||
boost::system::error_code ec;
|
||||
const QString ip_str = misc::toQString(ip.address().to_string(ec));
|
||||
if (ec) return;
|
||||
if(m_cache.contains(ip_str)) {
|
||||
qDebug("Resolved host name using cache");
|
||||
emit ip_resolved(ip_str, *m_cache.object(ip_str));
|
||||
|
||||
Reference in New Issue
Block a user