From eecc78b931dc2ddb467aae79654b2d4d1739ab0c Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 26 Jul 2009 02:27:52 +0000 Subject: [PATCH] dll export fix + reverting upload slot change --- include/libtorrent/error_code.hpp | 4 +++- include/libtorrent/time.hpp | 2 +- src/error_code.cpp | 3 ++- src/session_impl.cpp | 8 ++------ 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/libtorrent/error_code.hpp b/include/libtorrent/error_code.hpp index 145478b22..f683c98c3 100644 --- a/include/libtorrent/error_code.hpp +++ b/include/libtorrent/error_code.hpp @@ -197,9 +197,11 @@ namespace libtorrent inline asio::error::error_category get_posix_category() { return asio::error::system_category; } inline asio::error::error_category get_system_category() { return asio::error::system_category; } - extern asio::error::error_category libtorrent_category; + extern TORRENT_EXPORT asio::error::error_category libtorrent_category; #else + class TORRENT_EXPORT boost::system::error_category; + struct TORRENT_EXPORT libtorrent_error_category : boost::system::error_category { virtual const char* name() const; diff --git a/include/libtorrent/time.hpp b/include/libtorrent/time.hpp index 80e980d7c..464dba78f 100644 --- a/include/libtorrent/time.hpp +++ b/include/libtorrent/time.hpp @@ -398,7 +398,7 @@ namespace libtorrent { namespace aux { - extern ptime g_current_time; + extern TORRENT_EXPORT ptime g_current_time; } inline ptime const& time_now() { return aux::g_current_time; } diff --git a/src/error_code.cpp b/src/error_code.cpp index 73e054e46..4d9c8cdc0 100644 --- a/src/error_code.cpp +++ b/src/error_code.cpp @@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. #include +#include "libtorrent/config.hpp" #include "libtorrent/error_code.hpp" namespace libtorrent @@ -193,7 +194,7 @@ namespace libtorrent #else - ::asio::error::error_category libtorrent_category(20); + TORRENT_EXPORT ::asio::error::error_category libtorrent_category(20); #endif diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 107f8a61a..a7aee3af0 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -150,7 +150,7 @@ namespace aux { // than a system call and can be // used where more accurate time // is not necessary - ptime g_current_time = time_now_hires(); + TORRENT_EXPORT ptime g_current_time = time_now_hires(); struct seed_random_generator { @@ -1873,8 +1873,6 @@ namespace aux { peers.push_back(p.get()); } - // if the client is configured to use fully automatic - // unchoke slots, m_max_uploads is still a lower limit if (m_settings.auto_upload_slots_rate_based && m_settings.auto_upload_slots) { @@ -1907,9 +1905,7 @@ namespace aux { int rate = p.uploaded_since_unchoke() * 1000 / total_milliseconds(unchoke_interval); - if (rate < rate_threshold - && m_allowed_upload_slots >= m_max_uploads) - break; + if (rate < rate_threshold) break; ++m_allowed_upload_slots;