dll export fix + reverting upload slot change

This commit is contained in:
Arvid Norberg 2009-07-26 02:27:52 +00:00
parent 5b604e2a3a
commit eecc78b931
4 changed files with 8 additions and 9 deletions

View File

@ -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;

View File

@ -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; }

View File

@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/version.hpp>
#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

View File

@ -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;