Exemplo n.º 1
0
void print_bitfield(bitfield const& b)
{
	std::string out;
	out.reserve(b.size());
	for (bool bit : b)
		out += bit ? '1' : '0';
	std::printf("%s\n", out.c_str());
}
Exemplo n.º 2
0
void print_bitfield(bitfield const& b)
{
	std::string out;
	for (int i = 0; i < b.size(); ++i)
	{
		out += b.get_bit(i) ? "1" : "0";
	}
	std::printf("%s\n", out.c_str());
}
Exemplo n.º 3
0
		void peer_lost(bitfield const& bits, peer_connection const* peer)
		{
			if (has_picker())
			{
				if (bits.all_set() && bits.size() > 0)
					m_picker->dec_refcount_all(peer);
				else
					m_picker->dec_refcount(bits, peer);
			}
#ifdef TORRENT_DEBUG
			else
			{
				TORRENT_ASSERT(is_seed());
			}
#endif
		}
Exemplo n.º 4
0
		bitfield(bitfield const& rhs) { assign(rhs.data(), rhs.size()); }