lt sync 1929
This commit is contained in:
parent
49c09bf297
commit
dbe41a3cd5
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -452,15 +452,19 @@ namespace libtorrent
|
|||
// the directory exists.
|
||||
if (file_iter->size == 0)
|
||||
{
|
||||
try {
|
||||
file(m_save_path / file_iter->path, file::out);
|
||||
} catch (std::exception&) {}
|
||||
continue;
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue