comment out verbose pex logging. fix bug in disabled_storage and an error reporting issue on short reads in default_storage

This commit is contained in:
arvidn 2016-01-10 11:50:56 -05:00
parent fcccd026be
commit 4cc2e879c4
3 changed files with 13 additions and 11 deletions

View File

@ -2341,7 +2341,7 @@ namespace libtorrent
return 0;
}
}
if (pe == NULL && !m_settings.get_bool(settings_pack::use_read_cache))
{
l.unlock();
@ -2468,6 +2468,7 @@ namespace libtorrent
if (ret < 0)
{
TORRENT_ASSERT(j->error.ec && j->error.operation != 0);
m_disk_cache.free_buffer(static_cast<char*>(iov.iov_base));
l.lock();
break;
@ -2481,6 +2482,7 @@ namespace libtorrent
ret = -1;
j->error.ec.assign(boost::asio::error::eof
, boost::asio::error::get_misc_category());
j->error.operation = storage_error::read;
m_disk_cache.free_buffer(static_cast<char*>(iov.iov_base));
l.lock();
break;

View File

@ -1520,16 +1520,16 @@ namespace libtorrent
return new default_storage(params);
}
int disabled_storage::readv(file::iovec_t const*
, int, int, int, int, storage_error&)
int disabled_storage::readv(file::iovec_t const* bufs
, int num_bufs, int, int, int, storage_error&)
{
return 0;
return bufs_size(bufs, num_bufs);
}
int disabled_storage::writev(file::iovec_t const*
, int, int, int, int, storage_error&)
int disabled_storage::writev(file::iovec_t const* bufs
, int num_bufs, int, int, int, storage_error&)
{
return 0;
return bufs_size(bufs, num_bufs);
}
storage_interface* disabled_storage_constructor(storage_params const& params)

View File

@ -439,8 +439,8 @@ namespace libtorrent { namespace
if (now - seconds(60) < m_last_msg)
{
#ifndef TORRENT_DISABLE_LOGGING
m_pc.peer_log(peer_log_alert::info, "PEX", "waiting: %d seconds to next msg"
, int(total_seconds(seconds(60) - (now - m_last_msg))));
// m_pc.peer_log(peer_log_alert::info, "PEX", "waiting: %d seconds to next msg"
// , int(total_seconds(seconds(60) - (now - m_last_msg))));
#endif
return;
}
@ -457,8 +457,8 @@ namespace libtorrent { namespace
if (now - milliseconds(delay) < global_last)
{
#ifndef TORRENT_DISABLE_LOGGING
m_pc.peer_log(peer_log_alert::info, "PEX", "global-wait: %d"
, int(total_seconds(milliseconds(delay) - (now - global_last))));
// m_pc.peer_log(peer_log_alert::info, "PEX", "global-wait: %d"
// , int(total_seconds(milliseconds(delay) - (now - global_last))));
#endif
return;
}