From 39d14146e7430cd52f12d7e44524891da9be3d08 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 27 Nov 2009 21:04:26 +0000 Subject: [PATCH] dynamic_cast fix --- src/session_impl.cpp | 4 +++- src/torrent.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index a92cfe772..4cdf3b0c9 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -291,9 +291,11 @@ namespace aux { PRINT_SIZEOF(bt_peer_connection) PRINT_SIZEOF(address) PRINT_SIZEOF(address_v4) - PRINT_SIZEOF(address_v6) PRINT_SIZEOF(address_v4::bytes_type) +#if TORRENT_USE_IPV6 + PRINT_SIZEOF(address_v6) PRINT_SIZEOF(address_v6::bytes_type) +#endif PRINT_SIZEOF(void*) PRINT_SIZEOF(dht::node_entry) diff --git a/src/torrent.cpp b/src/torrent.cpp index 1e89841d1..9b5cdcde8 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -430,8 +430,8 @@ namespace libtorrent for (std::set::iterator i = m_connections.begin() , end(m_connections.end()); i != end; ++i) { - bt_peer_connection* p = dynamic_cast(*i); - if (p == 0) continue; + if ((*i)->type() != peer_connection::bittorrent_connection) continue; + bt_peer_connection* p = (bt_peer_connection*)*i; p->write_upload_only(); } #endif