mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Fix exceptions on Windows XP when IPv6 is disabled (Thanks paolo zambotti)
This commit is contained in:
parent
86d3c98069
commit
122db6a77e
3 changed files with 23 additions and 8 deletions
|
@ -288,13 +288,15 @@ void PeerListWidget::saveSettings() const {
|
|||
|
||||
void PeerListWidget::loadPeers(const QTorrentHandle &h, bool force_hostname_resolution) {
|
||||
if(!h.is_valid()) return;
|
||||
boost::system::error_code ec;
|
||||
std::vector<peer_info> peers;
|
||||
h.get_peer_info(peers);
|
||||
std::vector<peer_info>::iterator itr;
|
||||
QSet<QString> old_peers_set = peerItems.keys().toSet();
|
||||
for(itr = peers.begin(); itr != peers.end(); itr++) {
|
||||
peer_info peer = *itr;
|
||||
QString peer_ip = misc::toQString(peer.ip.address().to_string());
|
||||
QString peer_ip = misc::toQString(peer.ip.address().to_string(ec));
|
||||
if(ec) continue;
|
||||
if(peerItems.contains(peer_ip)) {
|
||||
// Update existing peer
|
||||
updatePeer(peer_ip, peer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue