diff --git a/docs/manual.html b/docs/manual.html index 23e53fb12..46a0799e6 100755 --- a/docs/manual.html +++ b/docs/manual.html @@ -114,6 +114,7 @@ peers in a separate fast-resume file. send have messages to peers that already has the piece. This saves bandwidth.
Functions that are yet to be implemented:
diff --git a/docs/manual.rst b/docs/manual.rst index 32fc56926..9e69b8cca 100755 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -46,6 +46,7 @@ The current state includes the following features: send have messages to peers that already has the piece. This saves bandwidth. * does not have any requirements on the piece order in a torrent that it resumes. This means it can resume a torrent downloaded by any client. + * adjusts the length of the request queue depending on download rate. __ http://home.elp.rr.com/tur/multitracker-spec.txt .. _Azureus: http://azureus.sourceforge.net diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 797082b87..cda60cc4b 100755 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -348,11 +348,6 @@ int main(int argc, char* argv[]) }; i->get_peer_info(peers); - float down = s.download_rate; - float up = s.upload_rate; - size_type total_down = s.total_download; - size_type total_up = s.total_upload; - int num_peers = (int)peers.size(); out.precision(4); out.width(5); @@ -361,12 +356,12 @@ int main(int argc, char* argv[]) out << progress_bar(s.progress, 49); out << "\n"; out << "total downloaded: " << s.total_done << " Bytes\n"; - out << "peers: " << num_peers << " " - << "d:" << add_suffix(down) << "/s " - << "(" << add_suffix(total_down) << ") " - << "u:" << add_suffix(up) << "/s " - << "(" << add_suffix(total_up) << ") " - << "ratio: " << ratio(total_down, total_up) << "\n"; + out << "peers: " << (int)peers.size() << " " + << "d:" << add_suffix(s.download_rate) << "/s " + << "(" << add_suffix(s.total_download) << ") " + << "u:" << add_suffix(s.upload_rate) << "/s " + << "(" << add_suffix(s.total_upload) << ") " + << "ratio: " << ratio(s.total_payload_download, s.total_payload_upload) << "\n"; boost::posix_time::time_duration t = s.next_announce; out << "next announce: " << boost::posix_time::to_simple_string(t) << "\n"; diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index 8f8e18c05..a83fa0649 100755 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -150,7 +150,7 @@ namespace libtorrent { boost::posix_time::time_duration d; d = boost::posix_time::second_clock::local_time() - m_last_receive; - return d.seconds() > m_timeout; + return d > boost::posix_time::seconds(m_timeout); } // will send a keep-alive message to the peer diff --git a/src/policy.cpp b/src/policy.cpp index 1d8123dd9..4c0ef04c9 100755 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -115,7 +115,7 @@ namespace // matlab expression to plot: // x = 1:100:100000; plot(x, round(min(max(x ./ 5000 + 1.5, 2), 16))); - int desired_queue_size = rate / 5000.f + 1.5f; + int desired_queue_size = static_cast