lt sync 1929

This commit is contained in:
Marcos Pinto 2008-01-11 20:25:08 +00:00
parent 49c09bf297
commit dbe41a3cd5
3 changed files with 16 additions and 8 deletions

View File

@ -96,8 +96,10 @@ namespace libtorrent
// time since last download or upload
time_duration last_active;
// the size of the send buffer for this peer
// the size of the send buffer for this peer, in bytes
int send_buffer_size;
// the number bytes that's actually used of the send buffer
int used_send_buffer;
// the number of failed hashes for this peer
int num_hashfails;

View File

@ -2073,7 +2073,8 @@ namespace libtorrent
bool peer_connection::on_local_network() const
{
if (libtorrent::is_local(m_remote.address())) return true;
if (libtorrent::is_local(m_remote.address())
|| is_loopback(m_remote.address())) return true;
return false;
}
@ -2156,6 +2157,7 @@ namespace libtorrent
}
p.send_buffer_size = m_send_buffer.capacity();
p.used_send_buffer = m_send_buffer.size();
}
void peer_connection::cut_receive_buffer(int size, int packet_size)

View File

@ -452,15 +452,19 @@ namespace libtorrent
// the directory exists.
if (file_iter->size == 0)
{
file(m_save_path / file_iter->path, file::out);
try {
file(m_save_path / file_iter->path, file::out);
} catch (std::exception&) {}
continue;
}
if (allocate_files)
{
m_files.open_file(this, m_save_path / file_iter->path, file::in | file::out)
->set_size(file_iter->size);
}
try {
if (allocate_files)
{
m_files.open_file(this, m_save_path / file_iter->path, file::in | file::out)
->set_size(file_iter->size);
}
} catch (std::exception&) {}
}
// close files that were opened in write mode
m_files.release(this);