From 32fc19002aa9832642b4eef984bc74542706b7c7 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 4 Feb 2004 11:00:29 +0000 Subject: [PATCH] *** empty log message *** --- Jamfile | 35 +++++++++++++++++++++-------------- docs/manual.rst | 2 ++ src/policy.cpp | 21 ++++++++++----------- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/Jamfile b/Jamfile index b9189e4ef..c08e40ed7 100755 --- a/Jamfile +++ b/Jamfile @@ -1,3 +1,15 @@ +project torrent + : usage-requirements + ./include + $(BOOST_ROOT) + +# devstudio fixes + + /Zc:wchar_t + /D"WIN32" + ; + + SOURCES = entry.cpp identify_client.cpp @@ -20,16 +32,13 @@ SOURCES = lib torrent - : src/$(SOURCES) -# zlib/zlib -# zlib//zlib -# boost_filesystem.lib -# boost_date_time.lib -# boost_thread.dll - : $(BOOST_ROOT) - $(BOOST_ROOT) - ./include - ./zlib + : +# $(BOOST_ROOT)/libs/filesystem//boost_filesystem +# $(BOOST_ROOT)/libs/thread//boost_thread +# $(BOOST_ROOT)/libs/date_time//boost_date_time + zlib//zlib + src/$(SOURCES) + : ./include multi static : debug release @@ -38,10 +47,8 @@ lib torrent exe client_test : examples/client_test.cpp - torrent - : $(BOOST_ROOT) - $(BOOST_ROOT) - ./include + torrent + : $(BOOST_ROOT) multi : debug release ; diff --git a/docs/manual.rst b/docs/manual.rst index 632943918..3e87b2fac 100755 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -88,6 +88,8 @@ Then you can use ``bjam`` to build libtorrent. .. _boost: http://www.boost.org +__ http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=80982 + To make bjam work, you need to set the environment variable ``BOOST_ROOT`` to the path where boost is installed (e.g. c:\\boost_1_30_2 on windows). Then you can just run ``bjam`` in the libtorrent directory. diff --git a/src/policy.cpp b/src/policy.cpp index 89f25d571..ec559eb27 100755 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -198,18 +198,9 @@ namespace { // we probably couldn't request the block because // we are ignoring some peers - return; + break; } - // this peer doesn't have a faster connection than the - // slowest peer. Don't take over any blocks - const int queue_size = (int)c.download_queue().size(); - const float weight = queue_size == 0 - ? std::numeric_limits::max() - : c.statistics().down_peak() / queue_size; - - if (weight <= min_weight) return; - // find a suitable block to take over from this peer std::deque::const_reverse_iterator common_block = @@ -229,8 +220,16 @@ namespace // that just took over its block ignore.push_back(&c); request_a_block(t, *peer, ignore); - num_requests--; + + // this peer doesn't have a faster connection than the + // slowest peer. Don't take over any blocks + const int queue_size = (int)c.download_queue().size(); + const float weight = queue_size == 0 + ? std::numeric_limits::max() + : c.statistics().down_peak() / queue_size; + + if (weight <= min_weight) break; } }