merged RC_1_1 into master

This commit is contained in:
arvidn 2016-07-05 18:03:06 -04:00
commit 98af1cd54e
13 changed files with 65 additions and 52 deletions

View File

@ -130,13 +130,13 @@ script:
- cd ../examples
- 'if [ "$variant" != "" ]; then
bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto variant=$variant picker-debugging=on $toolset link=shared;
bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full variant=$variant picker-debugging=on $toolset link=shared;
fi'
- cd ..
- cd tools
- 'if [ "$variant" != "" ]; then
bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto variant=$variant picker-debugging=on $toolset link=shared;
bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full variant=$variant picker-debugging=on $toolset link=shared;
fi'
- cd ..
@ -145,12 +145,12 @@ script:
# as the main library, so we cannot stage them to the same directory
# here we specify the temporary lib dir as a path to look for the main library
- 'if [ "$variant" != "" ]; then
bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto picker-debugging=on link=shared variant=$variant $toolset install location=./lib;
bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full link=shared variant=$variant $toolset install location=./lib;
fi'
- cd bindings/python
- 'if [ "$variant" != "" ]; then
bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto variant=$variant picker-debugging=on $toolset stage_module libtorrent-link=shared install-type=LIB dll-path=../../lib &&
bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto variant=$variant debug-iterators=on picker-debugging=on invariant-checks=full $toolset stage_module libtorrent-link=shared install-type=LIB dll-path=../../lib &&
LD_LIBRARY_PATH=../../lib DYLD_LIBRARY_PATH=../../lib python test.py;
fi'
- cd ../..;

View File

@ -26,6 +26,9 @@
1.1.1 release
* fix bug where file_completed_alert would not be posted unless file_progress
had been queries by the client
* move files one-by-one when moving storage for a torrent
* fix bug in enum_net() for BSD and Mac
* fix bug in python binding of announce_entry
* fixed bug related to flag_merge_resume_http_seeds flag in add_torrent_params

View File

@ -74,7 +74,7 @@ cache:
build_script:
# examples
- cd %ROOT_DIRECTORY%\examples
- b2.exe --hash warnings-as-errors=on -j2 %compiler% ssl=%ssl% crypto=%crypto% address-model=%model% variant=%variant% picker-debugging=on %linkflags% %include% link=shared
- b2.exe --hash warnings-as-errors=on -j2 %compiler% ssl=%ssl% crypto=%crypto% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% picker-debugging=on %linkflags% %include% link=shared
# tools
- cd %ROOT_DIRECTORY%\tools

View File

@ -61,6 +61,7 @@ namespace aux
void export_progress(std::vector<std::int64_t> &fp);
bool empty() const { return m_file_progress.empty(); }
void clear();
void update(file_storage const& fs, int index

View File

@ -514,7 +514,7 @@ POSSIBILITY OF SUCH DAMAGE.
#if (defined _M_AMD64 || defined _M_IX86 || defined _M_X64 \
|| defined __amd64__ || defined __i386 || defined __i386__ \
|| defined __x86_64__ || defined __x86_64) \
&& (defined __GNUC__ || defined _MSC_VER)
&& (defined __GNUC__ || (defined _MSC_VER && _MSC_VER >= 1600))
#define TORRENT_HAS_SSE 1
#else
#define TORRENT_HAS_SSE 0

View File

@ -765,10 +765,14 @@ namespace libtorrent
return std::binary_search(m_predictive_pieces.begin(), m_predictive_pieces.end(), index);
}
private:
// called when we learn that we have a piece
// only once per piece
void we_have(int index);
public:
int num_have() const
{
// pretend we have every piece when in seed mode

@ -1 +1 @@
Subproject commit 1df1d608358ed93cc5024ad731df7d047508554f
Subproject commit c19b35e05831ad46cefd1a9e9f8b022c799bc8d0

View File

@ -435,6 +435,41 @@ TORRENT_TEST(delete_partfile)
TEST_CHECK(!ec);
}
TORRENT_TEST(torrent_completed_alert)
{
int num_file_completed = false;
setup_swarm(2, swarm_test::download
// add session
, [](lt::settings_pack& pack)
{
pack.set_int(lt::settings_pack::alert_mask, alert::progress_notification);
}
// add torrent
, [](lt::add_torrent_params&) {}
// on alert
, [&](lt::alert const* a, lt::session&)
{
auto tc = alert_cast<lt::file_completed_alert>(a);
if (tc == nullptr) return;
++num_file_completed;
}
// terminate
, [](int ticks, lt::session& ses) -> bool
{
if (ticks > 80)
{
TEST_ERROR("timeout");
return true;
}
if (!is_seed(ses)) return false;
printf("completed in %d ticks\n", ticks);
return true;
});
TEST_EQUAL(num_file_completed, 1);
}
// TODO: add test that makes sure a torrent in graceful pause mode won't make
// outgoing connections
// TODO: add test that makes sure a torrent in graceful pause mode won't accept

View File

@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/crc.hpp>
#ifdef _MSC_VER
#if (defined _MSC_VER && _MSC_VER >= 1600)
#include <nmmintrin.h>
#endif

View File

@ -97,7 +97,7 @@ namespace libtorrent { namespace aux
while (size)
{
std::int64_t add = (std::min)(size, fs.file_size(file_index) - file_offset);
std::int64_t const add = (std::min)(size, fs.file_size(file_index) - file_offset);
TORRENT_ASSERT(add >= 0);
m_file_progress[file_index] += add;

View File

@ -1088,6 +1088,7 @@ namespace libtorrent
{
error_code err;
std::string subdir = combine_path(old_save_path, s);
while (subdir != old_save_path && !err)
{
remove(subdir, err);

View File

@ -1272,6 +1272,13 @@ namespace libtorrent
+ block_size() - 1) / block_size();
m_picker->init(blocks_per_piece, blocks_in_last_piece, m_torrent_file->num_pieces());
// initialize the file progress too
if (m_file_progress.empty())
{
TORRENT_ASSERT(has_picker());
m_file_progress.init(picker(), m_torrent_file->files());
}
update_gauge();
for (peer_iterator i = m_connections.begin()
@ -2400,7 +2407,6 @@ namespace libtorrent
// removing the piece picker will clear the user priorities
// instead, just clear which pieces we have
// m_picker.reset();
if (m_picker)
{
int blocks_per_piece = (m_torrent_file->piece_length() + block_size() - 1) / block_size();
@ -10683,13 +10689,6 @@ namespace libtorrent
return;
}
// if this is the first time the client asks for file progress.
// allocate it and make sure it's up to date
// we cover the case where we're a seed above
TORRENT_ASSERT(has_picker());
m_file_progress.init(picker(), m_torrent_file->files());
m_file_progress.export_progress(fp);
if (flags & torrent_handle::piece_granularity)

View File

@ -22,38 +22,6 @@ exe enum_if : enum_if.cpp /torrent//torrent
explicit test_natpmp ;
explicit enum_if ;
rule link_test ( properties * )
{
local result ;
if <link>shared in $(properties)
{
result +=
<library>libtorrent_test/<link>shared ;
}
else
{
result +=
<library>libtorrent_test/<link>static ;
}
return $(result) ;
}
rule link_libtorrent ( properties * )
{
local result ;
if <link>shared in $(properties)
{
result +=
<library>/torrent//torrent/<link>shared/<boost-link>shared ;
}
else
{
result +=
<library>/torrent//torrent/<link>static/<boost-link>static ;
}
return $(result) ;
}
lib libtorrent_test
: # sources
main.cpp
@ -77,7 +45,8 @@ lib libtorrent_test
<link>shared:<define>ED25519_BUILD_DLL
<include>../ed25519/src
<target-os>windows:<library>advapi32
<conditional>@link_libtorrent
<library>/torrent//torrent
<export-extra>on
<toolset>darwin:<cflags>-Wno-unused-command-line-argument
# disable warning C4275: non DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
<toolset>msvc:<cflags>/wd4275
@ -96,8 +65,9 @@ lib advapi32 : : <name>Advapi32 ;
project
: requirements
<conditional>@link_test
<conditional>@link_libtorrent
<export-extra>on
<library>libtorrent_test
<library>/torrent//torrent
<toolset>darwin:<cflags>-Wno-unused-command-line-argument
# disable warning C4275: non DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
<toolset>msvc:<cflags>/wd4275