forked from premiere/premiere-libtorrent
*** 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 =
|
||||
entry.cpp
|
||||
identify_client.cpp
|
||||
|
@ -20,16 +32,13 @@ SOURCES =
|
|||
|
||||
|
||||
lib torrent
|
||||
: src/$(SOURCES)
|
||||
# <lib>zlib/zlib
|
||||
# zlib//zlib
|
||||
# <file>boost_filesystem.lib
|
||||
# <file>boost_date_time.lib
|
||||
# <file>boost_thread.dll
|
||||
: <include>$(BOOST_ROOT)
|
||||
<sysinclude>$(BOOST_ROOT)
|
||||
<include>./include
|
||||
<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>./include
|
||||
<threading>multi
|
||||
<link>static
|
||||
: debug release
|
||||
|
@ -38,10 +47,8 @@ lib torrent
|
|||
|
||||
exe client_test
|
||||
: examples/client_test.cpp
|
||||
<lib>torrent
|
||||
: <include>$(BOOST_ROOT)
|
||||
<sysinclude>$(BOOST_ROOT)
|
||||
<include>./include
|
||||
torrent
|
||||
: <sysinclude>$(BOOST_ROOT)
|
||||
<threading>multi
|
||||
: debug release
|
||||
;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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<float>::max()
|
||||
: c.statistics().down_peak() / queue_size;
|
||||
|
||||
if (weight <= min_weight) return;
|
||||
|
||||
// find a suitable block to take over from this peer
|
||||
|
||||
std::deque<piece_block>::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<float>::max()
|
||||
: c.statistics().down_peak() / queue_size;
|
||||
|
||||
if (weight <= min_weight) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue