Merge pull request #292 from thomas-yuan/observer_size

Fix observer_size.
This commit is contained in:
Arvid Norberg 2015-11-23 18:59:53 -05:00
commit 173801d1f4
1 changed files with 9 additions and 1 deletions

View File

@ -51,6 +51,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <libtorrent/kademlia/node.hpp>
#include <libtorrent/kademlia/observer.hpp>
#include <libtorrent/kademlia/dht_observer.hpp>
#include <libtorrent/kademlia/direct_request.hpp>
#include <libtorrent/kademlia/get_item.hpp>
#include <libtorrent/socket_io.hpp> // for print_endpoint
#include <libtorrent/hasher.hpp>
@ -156,10 +158,16 @@ void observer::set_id(node_id const& id)
if (m_algorithm) m_algorithm->resort_results();
}
enum { observer_size = max3<
enum { observer_size = max9<
sizeof(find_data_observer)
, sizeof(announce_observer)
, sizeof(put_data_observer)
, sizeof(direct_observer)
, sizeof(get_item_observer)
, sizeof(get_peers_observer)
, sizeof(obfuscated_get_peers_observer)
, sizeof(null_observer)
, sizeof(traversal_observer)
>::value
};