updated Makefile for latest asio, fix in peer exchange, updated client_test output

This commit is contained in:
Arvid Norberg 2007-01-02 17:44:15 +00:00
parent 442039ea28
commit 08e15e2f0c
4 changed files with 17 additions and 4 deletions

View File

@ -870,10 +870,14 @@ int main(int ac, char* av[])
out << "peers: " << s.num_peers << " " out << "peers: " << s.num_peers << " "
<< "seeds: " << s.num_seeds << " " << "seeds: " << s.num_seeds << " "
<< "distributed copies: " << s.distributed_copies << "\n"; << "distributed copies: " << s.distributed_copies << "\n";
out << "download: " << esc("32") << add_suffix(s.download_rate) << "/s " << esc("0")
<< "(" << esc("32") << add_suffix(s.total_download) << esc("0") << ") ";
} }
out << "download: " << esc("32") << add_suffix(s.download_rate) << "/s " << esc("0") else
<< "(" << esc("32") << add_suffix(s.total_download) << esc("0") << ") " {
<< "upload: " << esc("31") << add_suffix(s.upload_rate) << "/s " << esc("0") out << "download: " << "(" << esc("32") << add_suffix(s.total_download) << esc("0") << ") ";
}
out << "upload: " << esc("31") << add_suffix(s.upload_rate) << "/s " << esc("0")
<< "(" << esc("31") << add_suffix(s.total_upload) << esc("0") << ") " << "(" << esc("31") << add_suffix(s.total_upload) << esc("0") << ") "
<< "ratio: " << ratio(s.total_payload_download, s.total_payload_upload) << "\n"; << "ratio: " << ratio(s.total_payload_download, s.total_payload_upload) << "\n";
if (s.state != torrent_status::seeding) if (s.state != torrent_status::seeding)

View File

@ -126,6 +126,9 @@ libtorrent/asio/detail/select_interrupter.hpp \
libtorrent/asio/detail/select_reactor.hpp \ libtorrent/asio/detail/select_reactor.hpp \
libtorrent/asio/detail/select_reactor_fwd.hpp \ libtorrent/asio/detail/select_reactor_fwd.hpp \
libtorrent/asio/detail/service_registry.hpp \ libtorrent/asio/detail/service_registry.hpp \
libtorrent/asio/detail/service_registry_fwd.hpp \
libtorrent/asio/detail/service_base.hpp \
libtorrent/asio/detail/service_id.hpp \
libtorrent/asio/detail/signal_blocker.hpp \ libtorrent/asio/detail/signal_blocker.hpp \
libtorrent/asio/detail/signal_init.hpp \ libtorrent/asio/detail/signal_init.hpp \
libtorrent/asio/detail/socket_holder.hpp \ libtorrent/asio/detail/socket_holder.hpp \

View File

@ -158,7 +158,7 @@ namespace
, map_entry("LP", "lphant") , map_entry("LP", "lphant")
, map_entry("LT", "libtorrent") , map_entry("LT", "libtorrent")
, map_entry("M", "Mainline") , map_entry("M", "Mainline")
, map_entry("ML", "MLDonkey") , map_entry("ML", "MLDonkey")
, map_entry("MP", "MooPolice") , map_entry("MP", "MooPolice")
, map_entry("MT", "Moonlight Torrent") , map_entry("MT", "Moonlight Torrent")
, map_entry("O", "Osprey Permaseed") , map_entry("O", "Osprey Permaseed")

View File

@ -83,7 +83,11 @@ namespace libtorrent { namespace
for (torrent::peer_iterator i = m_torrent.begin() for (torrent::peer_iterator i = m_torrent.begin()
, end(m_torrent.end()); i != end; ++i) , end(m_torrent.end()); i != end; ++i)
{ {
// don't send out peers that we haven't connected to
// (that have connected to us)
if (!i->second->is_local()) continue; if (!i->second->is_local()) continue;
// don't send out peers that we haven't successfully connected to
if (i->second->connecting()) continue;
cs.push_back(i->first); cs.push_back(i->first);
} }
std::list<tcp::endpoint> added_peers, dropped_peers; std::list<tcp::endpoint> added_peers, dropped_peers;
@ -101,6 +105,7 @@ namespace libtorrent { namespace
std::back_insert_iterator<std::string> pld_out(pld); std::back_insert_iterator<std::string> pld_out(pld);
std::back_insert_iterator<std::string> plf_out(plf); std::back_insert_iterator<std::string> plf_out(plf);
// TODO: use random selection in case added_peers.size() > num_peers
for (std::list<tcp::endpoint>::const_iterator i = added_peers.begin() for (std::list<tcp::endpoint>::const_iterator i = added_peers.begin()
, end(added_peers.end());i != end; ++i) , end(added_peers.end());i != end; ++i)
{ {
@ -114,6 +119,7 @@ namespace libtorrent { namespace
} }
num_peers = max_peer_entries; num_peers = max_peer_entries;
// TODO: use random selection in case dropped_peers.size() > num_peers
for (std::list<tcp::endpoint>::const_iterator i = dropped_peers.begin() for (std::list<tcp::endpoint>::const_iterator i = dropped_peers.begin()
, end(dropped_peers.end());i != end; ++i) , end(dropped_peers.end());i != end; ++i)
{ {