Fix banning of IPv6 peers

(cherry picked from commit 9eea35f530)
This commit is contained in:
Christophe Dumez 2011-12-28 11:31:46 +02:00
commit fd7fb115ff
2 changed files with 3 additions and 2 deletions

View file

@ -1,5 +1,6 @@
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.9.3 * Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.9.3
- BUGFIX: Fix btdigg plugin (Python3 support + torrent name in magnet links) - BUGFIX: Fix btdigg plugin (Python3 support + torrent name in magnet links)
- BUGFIX: Fix banning of IPv6 peers (Closes #885021)
- I18N: Add Georgian translation - I18N: Add Georgian translation
* Sat Oct 29 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.9.2 * Sat Oct 29 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.9.2

View file

@ -365,13 +365,13 @@ public:
start(); start();
} }
static void processFilterList(libtorrent::session *s, QStringList IPs) { static void processFilterList(libtorrent::session *s, const QStringList& IPs) {
// First, import current filter // First, import current filter
libtorrent::ip_filter filter = s->get_ip_filter(); libtorrent::ip_filter filter = s->get_ip_filter();
foreach(const QString &ip, IPs) { foreach(const QString &ip, IPs) {
qDebug("Manual ban of peer %s", ip.toLocal8Bit().constData()); qDebug("Manual ban of peer %s", ip.toLocal8Bit().constData());
boost::system::error_code ec; boost::system::error_code ec;
libtorrent::address_v4 addr = libtorrent::address_v4::from_string(ip.toLocal8Bit().constData(), ec); libtorrent::address addr = libtorrent::address::from_string(ip.toLocal8Bit().constData(), ec);
Q_ASSERT(!ec); Q_ASSERT(!ec);
if(!ec) if(!ec)
filter.add_rule(addr, addr, libtorrent::ip_filter::blocked); filter.add_rule(addr, addr, libtorrent::ip_filter::blocked);