merged changes from RC_1_0

This commit is contained in:
Arvid Norberg 2014-11-12 16:57:59 +00:00
parent 2514e7a0e2
commit bfb0c4fe80
7 changed files with 48 additions and 16 deletions

View File

@ -22,6 +22,9 @@ rm -f bindings/python/Makefile bindings/python/Makefile.in
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 --enable-tests
./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

View File

@ -110,9 +110,6 @@ AC_CACHE_CHECK([for __attribute__((visibility("hidden")))],
then
AS_ECHO "found"
ac_cv_hidden_visibility_attribute=yes
CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
CFLAGS="$CFLAGS -fvisibility=hidden"
LDFLAGS="$LDFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
fi
rm -f visibility_conftest.*
])
@ -232,6 +229,15 @@ AC_ARG_ENABLE(
[[ARG_ENABLE_ENCRYPTION=yes]]
)
AC_ARG_ENABLE(
[export-all],
[AS_HELP_STRING(
[--enable-export-all],
[export all symbols from libtorrent, including non-public ones [default=no]])],
[[ARG_ENABLE_FULL_EXPORT=$enableval]],
[[ARG_ENABLE_FULL_EXPORT=no]]
)
AC_ARG_ENABLE(
[pool-allocators],
[AS_HELP_STRING(
@ -463,6 +469,14 @@ AS_CASE(["$ARG_ENABLE_POOL_ALLOC"],
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_POOL_ALLOC". Use either "yes" or "no".])]
)
AS_IF([test "x$ac_cv_hidden_visibility_attribute" = "xyes"], [
AS_IF([test "x$ARG_ENABLE_FULL_EXPORT" = "xno"], [
CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
CFLAGS="$CFLAGS -fvisibility=hidden"
LDFLAGS="$LDFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
])
])
AS_ECHO
AS_ECHO "Checking for extra build files:"
@ -476,7 +490,11 @@ AS_CASE(["$ARG_ENABLE_EXAMPLES"],
AC_MSG_CHECKING([whether test files should be built])
AS_CASE(["$ARG_ENABLE_TESTS"],
["yes"], [AC_MSG_RESULT([yes])],
["yes"], [
AC_MSG_RESULT([yes])
AC_DEFINE([TORRENT_EXPORT_EXTRA],[1],[Define to export additional symbols for unit tests.])
COMPILETIME_OPTIONS="$COMPILETIME_OPTIONS -DTORRENT_EXPORT_EXTRA "
],
["no"], [AC_MSG_RESULT([no])],
[AC_MSG_RESULT([$ARG_ENABLE_TESTS])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_TESTS". Use either "yes" or "no".])]

View File

@ -253,12 +253,8 @@ namespace libtorrent
, sha1_hash const& info_hash);
~torrent();
sha1_hash const& info_hash() const
{
TORRENT_ASSERT(m_torrent_file);
static sha1_hash empty;
return m_torrent_file ? m_torrent_file->info_hash() : empty;
}
// This may be called from multiple threads
sha1_hash const& info_hash() const { return m_info_hash; }
bool is_deleted() const { return m_deleted; }
@ -1307,6 +1303,10 @@ namespace libtorrent
// in this swarm
time_t m_swarm_last_seen_complete;
// keep a copy if the info-hash here, so it can be accessed from multiple
// threads, and be cheap to access from the client
sha1_hash m_info_hash;
public:
// these are the lists this torrent belongs to. For more
// details about each list, see session_impl.hpp. Each list

View File

@ -1212,11 +1212,13 @@ namespace libtorrent
#endif // TORRENT_USE_WSTRING
#endif // TORRENT_NO_DEPRECATE
// Enables or disabled super seeding/initial seeding for this torrent. The torrent
// needs to be a seed for this to take effect.
// Enables or disabled super seeding/initial seeding for this torrent.
// The torrent needs to be a seed for this to take effect.
void super_seeding(bool on) const;
// ``info_hash()`` returns the info-hash for the torrent.
// ``info_hash()`` returns the info-hash of the torrent. If this handle
// is to a torrent that hasn't loaded yet (for instance by being added)
// by a URL, the returned value is undefined.
sha1_hash info_hash() const;
// comparison operators. The order of the torrents is unspecified

View File

@ -164,6 +164,7 @@ namespace libtorrent
, m_completed_time(0)
, m_last_seen_complete(0)
, m_swarm_last_seen_complete(0)
, m_info_hash(info_hash)
, m_num_verified(0)
, m_last_saved_resume(ses.session_time())
, m_started(ses.session_time())
@ -620,6 +621,7 @@ namespace libtorrent
alerts().post_alert(torrent_update_alert(get_handle(), info_hash(), tf->info_hash()));
m_torrent_file = tf;
m_info_hash = tf->info_hash();
// now, we might already have this torrent in the session.
boost::shared_ptr<torrent> t = m_ses.find_torrent(m_torrent_file->info_hash()).lock();
@ -8347,6 +8349,11 @@ namespace libtorrent
TORRENT_ASSERT((!m_allow_peers || m_graceful_pause_mode) && is_seed()); break;
}
if (m_torrent_file)
{
TORRENT_ASSERT(m_info_hash == m_torrent_file->info_hash());
}
#if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
for (int i = 0; i < aux::session_interface::num_torrent_lists; ++i)
{

View File

@ -216,9 +216,10 @@ namespace libtorrent
sha1_hash torrent_handle::info_hash() const
{
boost::shared_ptr<torrent> t = m_torrent.lock();
const static sha1_hash empty;
TORRENT_SYNC_CALL_RET(sha1_hash, empty, info_hash);
return r;
if (!t) return empty;
return t->info_hash();
}
int torrent_handle::max_uploads() const

View File

@ -177,6 +177,7 @@ test_time_critical_SOURCES = test_time_critical.cpp
test_super_seeding_SOURCES = test_super_seeding.cpp
test_swarm_SOURCES = test_swarm.cpp
test_tailqueue_SOURCES = test_tailqueue.cpp
test_resume_SOURCES = test_resume.cpp
test_rss_SOURCES = test_rss.cpp
test_ssl_SOURCES = test_ssl.cpp
test_threads_SOURCES = test_threads.cpp