*** empty log message ***
This commit is contained in:
parent
268d96020e
commit
32fc19002a
35
Jamfile
35
Jamfile
|
@ -1,3 +1,15 @@
|
||||||
|
project torrent
|
||||||
|
: usage-requirements
|
||||||
|
<include>./include
|
||||||
|
<include>$(BOOST_ROOT)
|
||||||
|
|
||||||
|
# devstudio fixes
|
||||||
|
|
||||||
|
<cxxflags>/Zc:wchar_t
|
||||||
|
<cxxflags>/D"WIN32"
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
SOURCES =
|
SOURCES =
|
||||||
entry.cpp
|
entry.cpp
|
||||||
identify_client.cpp
|
identify_client.cpp
|
||||||
|
@ -20,16 +32,13 @@ SOURCES =
|
||||||
|
|
||||||
|
|
||||||
lib torrent
|
lib torrent
|
||||||
: src/$(SOURCES)
|
:
|
||||||
# <lib>zlib/zlib
|
# $(BOOST_ROOT)/libs/filesystem//boost_filesystem
|
||||||
# zlib//zlib
|
# $(BOOST_ROOT)/libs/thread//boost_thread
|
||||||
# <file>boost_filesystem.lib
|
# $(BOOST_ROOT)/libs/date_time//boost_date_time
|
||||||
# <file>boost_date_time.lib
|
zlib//zlib
|
||||||
# <file>boost_thread.dll
|
src/$(SOURCES)
|
||||||
: <include>$(BOOST_ROOT)
|
: <include>./include
|
||||||
<sysinclude>$(BOOST_ROOT)
|
|
||||||
<include>./include
|
|
||||||
<include>./zlib
|
|
||||||
<threading>multi
|
<threading>multi
|
||||||
<link>static
|
<link>static
|
||||||
: debug release
|
: debug release
|
||||||
|
@ -38,10 +47,8 @@ lib torrent
|
||||||
|
|
||||||
exe client_test
|
exe client_test
|
||||||
: examples/client_test.cpp
|
: examples/client_test.cpp
|
||||||
<lib>torrent
|
torrent
|
||||||
: <include>$(BOOST_ROOT)
|
: <sysinclude>$(BOOST_ROOT)
|
||||||
<sysinclude>$(BOOST_ROOT)
|
|
||||||
<include>./include
|
|
||||||
<threading>multi
|
<threading>multi
|
||||||
: debug release
|
: debug release
|
||||||
;
|
;
|
||||||
|
|
|
@ -88,6 +88,8 @@ Then you can use ``bjam`` to build libtorrent.
|
||||||
|
|
||||||
.. _boost: http://www.boost.org
|
.. _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
|
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
|
path where boost is installed (e.g. c:\\boost_1_30_2 on windows). Then you can just run
|
||||||
``bjam`` in the libtorrent directory.
|
``bjam`` in the libtorrent directory.
|
||||||
|
|
|
@ -198,18 +198,9 @@ namespace
|
||||||
{
|
{
|
||||||
// we probably couldn't request the block because
|
// we probably couldn't request the block because
|
||||||
// we are ignoring some peers
|
// 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<float>::max()
|
|
||||||
: c.statistics().down_peak() / queue_size;
|
|
||||||
|
|
||||||
if (weight <= min_weight) return;
|
|
||||||
|
|
||||||
// find a suitable block to take over from this peer
|
// find a suitable block to take over from this peer
|
||||||
|
|
||||||
std::deque<piece_block>::const_reverse_iterator common_block =
|
std::deque<piece_block>::const_reverse_iterator common_block =
|
||||||
|
@ -229,8 +220,16 @@ namespace
|
||||||
// that just took over its block
|
// that just took over its block
|
||||||
ignore.push_back(&c);
|
ignore.push_back(&c);
|
||||||
request_a_block(t, *peer, ignore);
|
request_a_block(t, *peer, ignore);
|
||||||
|
|
||||||
num_requests--;
|
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<float>::max()
|
||||||
|
: c.statistics().down_peak() / queue_size;
|
||||||
|
|
||||||
|
if (weight <= min_weight) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue