rate limiter fix for metadata extension

This commit is contained in:
Arvid Norberg
2010-02-20 18:56:53 +00:00
parent b362795f9d
commit cead1b5780
4 changed files with 22 additions and 2 deletions

View File

@@ -207,6 +207,8 @@ namespace libtorrent { namespace
metadata();
}
int metadata_size() const { return m_metadata_size; }
private:
torrent& m_torrent;
@@ -285,6 +287,8 @@ namespace libtorrent { namespace
<< " ==> METADATA_REQUEST [ start: " << start << " | size: " << size << " ]\n";
#endif
m_pc.extension_expect_bytes(m_tp.metadata_size() == 0 ? 2048 : m_tp.metadata_size() * size / 255);
buffer::interval i = m_pc.allocate_send_buffer(9);
detail::write_uint32(1 + 1 + 3, i.begin);