mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
- Catch exception thrown by resolver.resolve() and display the error message on stderr
This commit is contained in:
parent
e645133baf
commit
873221ec14
1 changed files with 8 additions and 4 deletions
|
@ -70,10 +70,14 @@ signals:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void run() {
|
void run() {
|
||||||
boost::asio::ip::tcp::resolver::iterator it = resolver.resolve(ip);
|
try {
|
||||||
if(stopped) return;
|
boost::asio::ip::tcp::resolver::iterator it = resolver.resolve(ip);
|
||||||
boost::asio::ip::tcp::endpoint endpoint = *it;
|
if(stopped) return;
|
||||||
emit ip_resolved(misc::toQString(endpoint.address().to_string()), misc::toQString((*it).host_name()));
|
boost::asio::ip::tcp::endpoint endpoint = *it;
|
||||||
|
emit ip_resolved(misc::toQString(endpoint.address().to_string()), misc::toQString((*it).host_name()));
|
||||||
|
} catch(std::exception &e) {
|
||||||
|
std::cerr << "Hostname resolution failed, reason: " << e.what() << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue