forked from premiere/premiere-libtorrent
fix builds for all combinations of stats and disk stats
This commit is contained in:
parent
ca20d2d600
commit
3bc40b9980
|
@ -717,9 +717,11 @@ namespace libtorrent
|
|||
void check_invariant() const;
|
||||
#endif
|
||||
|
||||
#ifdef TORRENT_STATS
|
||||
#if defined TORRENT_STATS && defined TORRENT_DISK_STATS
|
||||
void log_buffer_usage();
|
||||
#endif
|
||||
|
||||
#if defined TORRENT_STATS
|
||||
// logger used to write bandwidth usage statistics
|
||||
std::ofstream m_stats_logger;
|
||||
int m_second_counter;
|
||||
|
|
|
@ -499,14 +499,14 @@ namespace libtorrent
|
|||
virtual buffer::interval allocate_send_buffer(int size);
|
||||
virtual void setup_send();
|
||||
|
||||
#if TORRENT_STATS
|
||||
#if defined TORRENT_STATS && defined TORRENT_DISK_STATS
|
||||
void log_buffer_usage(char* buffer, int size, char const* label);
|
||||
#endif
|
||||
|
||||
template <class Destructor>
|
||||
void append_send_buffer(char* buffer, int size, Destructor const& destructor)
|
||||
{
|
||||
#if TORRENT_STATS
|
||||
#if defined TORRENT_STATS && defined TORRENT_DISK_STATS
|
||||
log_buffer_usage(buffer, size, "queued send buffer");
|
||||
#endif
|
||||
m_send_buffer.append_buffer(buffer, size, size, destructor);
|
||||
|
|
|
@ -329,7 +329,7 @@ namespace libtorrent
|
|||
std::fill(m_peer_id.begin(), m_peer_id.end(), 0);
|
||||
}
|
||||
|
||||
#ifdef TORRENT_STATS
|
||||
#if defined TORRENT_STATS && defined TORRENT_DISK_STATS
|
||||
void peer_connection::log_buffer_usage(char* buffer, int size, char const* label)
|
||||
{
|
||||
if (m_ses.m_disk_thread.is_disk_buffer(buffer))
|
||||
|
@ -4321,7 +4321,7 @@ namespace libtorrent
|
|||
m_send_buffer.append(buf, free_space);
|
||||
size -= free_space;
|
||||
buf += free_space;
|
||||
#ifdef TORRENT_STATS
|
||||
#if defined TORRENT_STATS && defined TORRENT_DISK_STATS
|
||||
m_ses.m_buffer_usage_logger << log_time() << " send_buffer: "
|
||||
<< free_space << std::endl;
|
||||
m_ses.log_buffer_usage();
|
||||
|
@ -4339,7 +4339,7 @@ namespace libtorrent
|
|||
std::memcpy(buffer.first, buf, size);
|
||||
m_send_buffer.append_buffer(buffer.first, buffer.second, size
|
||||
, bind(&session_impl::free_buffer, boost::ref(m_ses), _1, buffer.second));
|
||||
#ifdef TORRENT_STATS
|
||||
#if defined TORRENT_STATS && defined TORRENT_DISK_STATS
|
||||
m_ses.m_buffer_usage_logger << log_time() << " send_buffer_alloc: " << size << std::endl;
|
||||
m_ses.log_buffer_usage();
|
||||
#endif
|
||||
|
@ -4364,7 +4364,7 @@ namespace libtorrent
|
|||
m_send_buffer.append_buffer(buffer.first, buffer.second, size
|
||||
, bind(&session_impl::free_buffer, boost::ref(m_ses), _1, buffer.second));
|
||||
buffer::interval ret(buffer.first, buffer.first + size);
|
||||
#ifdef TORRENT_STATS
|
||||
#if defined TORRENT_STATS && defined TORRENT_DISK_STATS
|
||||
m_ses.m_buffer_usage_logger << log_time() << " allocate_buffer_alloc: " << size << std::endl;
|
||||
m_ses.log_buffer_usage();
|
||||
#endif
|
||||
|
@ -4372,7 +4372,7 @@ namespace libtorrent
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef TORRENT_STATS
|
||||
#if defined TORRENT_STATS && defined TORRENT_DISK_STATS
|
||||
m_ses.m_buffer_usage_logger << log_time() << " allocate_buffer: " << size << std::endl;
|
||||
m_ses.log_buffer_usage();
|
||||
#endif
|
||||
|
|
|
@ -3395,7 +3395,7 @@ namespace aux {
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef TORRENT_STATS
|
||||
#if defined TORRENT_STATS && defined TORRENT_DISK_STATS
|
||||
void session_impl::log_buffer_usage()
|
||||
{
|
||||
int send_buffer_capacity = 0;
|
||||
|
|
Loading…
Reference in New Issue