From 3763a47846b927521b0eeca68b65940c9c68974e Mon Sep 17 00:00:00 2001 From: arvidn Date: Sat, 21 Jan 2017 12:08:53 -0500 Subject: [PATCH] fix truncation of peer_class field in torrent --- include/libtorrent/torrent.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp index 0e168ddc6..045ffc1ee 100644 --- a/include/libtorrent/torrent.hpp +++ b/include/libtorrent/torrent.hpp @@ -588,7 +588,7 @@ namespace libtorrent void set_download_limit(int limit); int download_limit() const; - peer_class_t peer_class() const { return peer_class_t(m_peer_class); } + peer_class_t peer_class() const { return m_peer_class; } void set_max_uploads(int limit, bool state_update = true); int max_uploads() const { return m_max_uploads; } @@ -1421,7 +1421,7 @@ namespace libtorrent // for torrents who have a bandwidth limit, this is != 0 // and refers to a peer_class in the session. - boost::uint16_t m_peer_class; + peer_class_t m_peer_class; // of all peers in m_connections, this is the number // of peers that are outgoing and still waiting to