Merge branch 'RC_1_1'

This commit is contained in:
arvidn 2016-04-11 02:08:06 -04:00
commit d17ae19391
13 changed files with 110 additions and 73 deletions

View File

@ -284,6 +284,8 @@ rule warnings ( properties * )
result += <cflags>/wd4018 ;
# disable warning C4244: 'argument' : conversion from 'int' to 'unsigned short', possible loss of data
result += <cflags>/wd4244 ;
# disable warning C4512: assignment operator could not be generated
result += <cflags>/wd4512 ;
}
return $(result) ;

View File

@ -23,8 +23,8 @@ chmod a-x docs/*.rst docs/*.htm* src/*.cpp include/libtorrent/*.hpp
./autotool.sh
./configure --enable-python-binding --enable-examples=yes --enable-encryption --enable-tests=yes --with-boost-system=mt --with-boost-chrono=mt --with-boost-random=mt --with-boost-python=mt
make V=1 -j8 check distcheck
./configure --enable-python-binding --enable-examples=yes --enable-encryption --with-boost-system=mt --with-boost-chrono=mt --with-boost-random=mt --with-boost-python=mt
make V=1 -j8 distcheck
./configure --enable-python-binding --enable-examples=yes --enable-encryption --with-boost-system=mt --with-boost-chrono=mt --with-boost-random=mt --with-boost-python=mt
make V=1 -j8 dist

View File

@ -589,6 +589,8 @@ for filename in files:
continue
if (l == 'namespace detail' or \
l == 'namespace dht_detail' or \
l == 'namespace impl' or \
l == 'namespace aux') \
and not internal:
lno = consume_block(lno, lines)

View File

@ -88,12 +88,12 @@ struct key_desc_t
};
// generate an error response message
void TORRENT_EXPORT incoming_error(entry& e, char const* msg, int error_code = 203);
void incoming_error(entry& e, char const* msg, int error_code = 203);
// given a redundant name to avoid clashing with libtorrent::detail
namespace dht_detail {
bool TORRENT_EXPORT verify_message(bdecode_node const& msg, key_desc_t const desc[]
TORRENT_EXPORT bool verify_message(bdecode_node const& msg, key_desc_t const desc[]
, bdecode_node ret[], int size, char* error, int error_size);
}

View File

@ -44,7 +44,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define LIBTORRENT_VERSION_NUM ((LIBTORRENT_VERSION_MAJOR * 10000) + (LIBTORRENT_VERSION_MINOR * 100) + LIBTORRENT_VERSION_TINY)
#define LIBTORRENT_VERSION "1.1.0.0"
#define LIBTORRENT_REVISION "7f05551"
#define LIBTORRENT_REVISION "044ee0f"
namespace libtorrent {

@ -1 +1 @@
Subproject commit 0151d5c17fa3f4cf0ce518d0b8f90a23792c9b24
Subproject commit 5f7cbb8bd222ed0e5cfdaffc2a2f5010fb5b4a29

View File

@ -2993,6 +2993,15 @@ namespace libtorrent
TORRENT_ASSERT(m_outstanding_writing_bytes >= 0);
// every peer is entitled to allocate a disk buffer if it has no writes outstanding
// see the comment in incoming_piece
if (m_outstanding_writing_bytes == 0
&& m_channel_state[download_channel] & peer_info::bw_disk)
{
m_counters.inc_stats_counter(counters::num_peers_down_disk, -1);
m_channel_state[download_channel] &= ~peer_info::bw_disk;
}
// flush send buffer at the end of
// this burst of disk events
// m_ses.cork_burst(this);

View File

@ -3025,6 +3025,9 @@ namespace aux {
m_last_tick = now;
m_utp_socket_manager.tick(now);
#ifdef TORRENT_USE_OPENSSL
m_ssl_utp_socket_manager.tick(now);
#endif
// only tick the following once per second
if (now - m_last_second_tick < seconds(1)) return;

View File

@ -31,12 +31,21 @@ test_programs = \
test_utp \
test_session \
test_web_seed \
test_web_seed_ban \
test_web_seed_chunked \
test_web_seed_http \
test_web_seed_http_pw \
test_web_seed_redirect \
test_web_seed_socks4 \
test_web_seed_socks5 \
test_web_seed_socks5_no_peers \
test_web_seed_socks5_pw \
test_url_seed \
test_remap_files \
test_enum_net \
test_file_progress \
test_linked_list
test_linked_list \
test_direct_dht
if ENABLE_TESTS
check_PROGRAMS = $(test_programs) $(benchmark_programs)
@ -46,48 +55,53 @@ endif
TESTS = $(test_programs)
EXTRA_DIST = Jamfile \
test_torrents/backslash_path.torrent \
test_torrents/base.torrent \
test_torrents/parent_path.torrent \
test_torrents/creation_date.torrent \
test_torrents/duplicate_files.torrent \
test_torrents/duplicate_web_seeds.torrent \
test_torrents/empty_httpseed.torrent \
test_torrents/empty_path.torrent \
test_torrents/empty_path_multi.torrent \
test_torrents/hidden_parent_path.torrent \
test_torrents/httpseed.torrent \
test_torrents/invalid_file_size.torrent \
test_torrents/invalid_info.torrent \
test_torrents/invalid_name.torrent \
test_torrents/invalid_name2.torrent \
test_torrents/invalid_name3.torrent \
test_torrents/invalid_path_list.torrent \
test_torrents/invalid_piece_len.torrent \
test_torrents/invalid_pieces.torrent \
test_torrents/invalid_root_hash.torrent \
test_torrents/invalid_root_hash2.torrent \
test_torrents/long_name.torrent \
test_torrents/missing_path_list.torrent \
test_torrents/missing_piece_len.torrent \
test_torrents/negative_file_size.torrent \
test_torrents/negative_piece_len.torrent \
test_torrents/negative_size.torrent \
test_torrents/no_creation_date.torrent \
test_torrents/no_name.torrent \
test_torrents/pad_file.torrent \
test_torrents/parent_path.torrent \
test_torrents/root_hash.torrent \
test_torrents/sample.torrent \
test_torrents/single_multi_file.torrent \
test_torrents/slash_path.torrent \
test_torrents/backslash_path.torrent \
test_torrents/slash_path2.torrent \
test_torrents/slash_path3.torrent \
test_torrents/string.torrent \
test_torrents/symlink1.torrent \
test_torrents/unaligned_pieces.torrent \
test_torrents/url_list.torrent \
test_torrents/url_list2.torrent \
test_torrents/url_list3.torrent \
test_torrents/httpseed.torrent \
test_torrents/empty_httpseed.torrent \
test_torrents/long_name.torrent \
test_torrents/whitespace_url.torrent \
test_torrents/duplicate_files.torrent \
test_torrents/invalid_piece_len.torrent \
test_torrents/missing_piece_len.torrent \
test_torrents/negative_piece_len.torrent \
test_torrents/no_name.torrent \
test_torrents/invalid_name.torrent \
test_torrents/invalid_name2.torrent \
test_torrents/invalid_info.torrent \
test_torrents/string.torrent \
test_torrents/negative_size.torrent \
test_torrents/negative_file_size.torrent \
test_torrents/pad_file.torrent \
test_torrents/invalid_path_list.torrent \
test_torrents/missing_path_list.torrent \
test_torrents/invalid_pieces.torrent \
test_torrents/unaligned_pieces.torrent \
test_torrents/creation_date.torrent \
test_torrents/no_creation_date.torrent \
test_torrents/url_seed.torrent \
test_torrents/url_seed_multi.torrent \
test_torrents/url_seed_multi_space.torrent \
test_torrents/url_seed_multi_space_nolist.torrent \
test_torrents/invalid_root_hash.torrent \
test_torrents/invalid_root_hash2.torrent \
test_torrents/root_hash.torrent \
test_torrents/invalid_file_size.torrent \
test_torrents/empty_path_multi.torrent \
test_torrents/duplicate_web_seeds.torrent \
test_torrents/sample.torrent \
test_torrents/whitespace_url.torrent \
mutable_test_torrents/test1.torrent \
mutable_test_torrents/test1_pad_files.torrent \
mutable_test_torrents/test1_single.torrent\
@ -97,13 +111,17 @@ EXTRA_DIST = Jamfile \
mutable_test_torrents/test3.torrent \
mutable_test_torrents/test3_pad_files.torrent \
zeroes.gz \
utf8_test.txt
utf8_test.txt \
web_server.py \
socks.py \
http.py
EXTRA_PROGRAMS = $(test_programs) $(benchmark_programs)
noinst_HEADERS = test.hpp setup_transfer.hpp dht_server.hpp \
peer_server.hpp udp_tracker.hpp web_seed_suite.hpp swarm_suite.hpp \
test_utils.hpp settings.hpp make_torrent.hpp
test_utils.hpp settings.hpp make_torrent.hpp bittorrent_peer.hpp \
print_alerts.hpp
libtest_la_SOURCES = main.cpp \
test.cpp \
@ -111,11 +129,13 @@ libtest_la_SOURCES = main.cpp \
dht_server.cpp \
udp_tracker.cpp \
peer_server.cpp \
bittorrent_peer.cpp \
make_torrent.cpp \
web_seed_suite.cpp \
swarm_suite.cpp \
test_utils.cpp \
settings.cpp
settings.cpp \
print_alerts.cpp
test_primitives_SOURCES = \
test_primitives.cpp \
@ -179,6 +199,7 @@ test_lsd_SOURCES = test_lsd.cpp
test_pe_crypto_SOURCES = test_pe_crypto.cpp
test_pex_SOURCES = test_pex.cpp
test_read_piece_SOURCES = test_read_piece.cpp
test_receive_buffer_SOURCES = test_receive_buffer.cpp
test_storage_SOURCES = test_storage.cpp
test_time_critical_SOURCES = test_time_critical.cpp
test_resume_SOURCES = test_resume.cpp
@ -190,11 +211,20 @@ enum_if_SOURCES = enum_if.cpp
test_utp_SOURCES = test_utp.cpp
test_session_SOURCES = test_session.cpp
test_web_seed_SOURCES = test_web_seed.cpp
test_web_seed_ban_SOURCES = test_web_seed_ban.cpp
test_web_seed_chunked_SOURCES = test_web_seed_chunked.cpp
test_web_seed_http_SOURCES = test_web_seed_http.cpp
test_web_seed_http_pw_SOURCES = test_web_seed_http_pw.cpp
test_web_seed_redirect_SOURCES = test_web_seed_redirect.cpp
test_web_seed_socks4_SOURCES = test_web_seed_socks4.cpp
test_web_seed_socks5_SOURCES = test_web_seed_socks5.cpp
test_web_seed_socks5_no_peers_SOURCES = test_web_seed_socks5_no_peers.cpp
test_web_seed_socks5_pw_SOURCES = test_web_seed_socks5_pw.cpp
test_url_seed_SOURCES = test_url_seed.cpp
test_remap_files_SOURCES = test_remap_files.cpp
test_file_progress_SOURCES = test_file_progress.cpp
test_linked_list_SOURCES = test_linked_list.cpp
test_direct_dht_SOURCES = test_direct_dht.cpp
LDADD = libtest.la $(top_builddir)/src/libtorrent-rasterbar.la

View File

@ -78,7 +78,7 @@ unit_test_t* current_test = NULL;
void output_test_log_to_terminal()
{
if (current_test == NULL || old_stdout == -1 || old_stderr == -1
|| !redirect_output)
|| !redirect_output || current_test->output == NULL)
return;
fflush(stdout);
@ -299,14 +299,25 @@ EXPORT int main(int argc, char const* argv[])
fflush(stdout);
fflush(stderr);
t.output = tmpfile();
int ret1 = dup2(fileno(t.output), fileno(stdout));
dup2(fileno(t.output), fileno(stderr));
if (ret1 < 0 )
FILE* f = tmpfile();
if (f != NULL)
{
fprintf(stderr, "failed to redirect output: (%d) %s\n"
, errno, strerror(errno));
continue;
int ret1 = dup2(fileno(f), fileno(stdout));
dup2(fileno(f), fileno(stderr));
if (ret1 >= 0)
{
t.output = f;
}
else
{
fprintf(stderr, "failed to redirect output: (%d) %s\n"
, errno, strerror(errno));
}
}
else
{
fprintf(stderr, "failed to create temporary file for redirecting "
"output: (%d) %s\n", errno, strerror(errno));
}
}
@ -350,7 +361,7 @@ EXPORT int main(int argc, char const* argv[])
total_failures += _g_test_failures;
++num_run;
if (redirect_output)
if (redirect_output && t.output)
{
fclose(t.output);
}

View File

@ -1,19 +0,0 @@
REM this is just to get libtorrent built
bjam -j8 msvc-12.0 invariant-checks=off asserts=off link=shared boost-link=shared test_primitives linkflags=/profile deprecated-functions=off
Vsinstr -coverage ..\bin\msvc-12.0\debug\asserts-off\boost-link-shared\boost-source\debug-iterators-on\deprecated-functions-off\export-extra-on\invariant-checks-off\threading-multi\torrent.dll @vsinstr_excludes.rsp
REM prepare for running all the tests again
del /s /q bin
del /q test.coverage
REM add vsperfmon to the path
set path=%path%;c:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools
Start vsperfmon -coverage -output:test.coverage
REM Now we run all the unit tests to record test coverage
bjam -j8 msvc-12.0 invariant-checks=off asserts=off link=shared boost-link=shared linkflags=/profile deprecated-functions=off
vsperfcmd -shutdown

View File

@ -232,8 +232,8 @@ void test_transfer(lt::session& ses, boost::shared_ptr<torrent_info> torrent_fil
, int(cnt["disk.disk_blocks_in_use"]));
test_sleep(100);
}
TEST_CHECK(std::abs(cnt["disk.disk_blocks_in_use"]
- (torrent_file->total_size() + 0x3fff) / 0x4000) <= 2);
TEST_CHECK(std::abs(int(cnt["disk.disk_blocks_in_use"]
- (torrent_file->total_size() + 0x3fff) / 0x4000)) <= 2);
}
}

View File

@ -12,7 +12,6 @@ EXTRA_DIST = Jamfile \
parse_dht_log.py \
parse_dht_rtt.py \
parse_dht_stats.py \
parse_access_log.py \
parse_disk_buffer_log.py\
parse_disk_log.py \
parse_memory_log.py \