fixed bug in metadata extensions combined with encryption

This commit is contained in:
Arvid Norberg
2010-06-18 05:44:08 +00:00
parent b882914461
commit 69001e6a6b
6 changed files with 34 additions and 5 deletions

View File

@@ -66,8 +66,6 @@ namespace libtorrent { namespace
return (numerator + denominator - 1) / denominator;
}
void nop(char*) {}
struct ut_metadata_plugin : torrent_plugin
{
ut_metadata_plugin(torrent& t)
@@ -283,8 +281,8 @@ namespace libtorrent { namespace
io::write_uint8(m_message_index, header);
m_pc.send_buffer(msg, len + 6);
if (metadata_piece_size) m_pc.append_send_buffer(
(char*)metadata, metadata_piece_size, &nop);
if (metadata_piece_size) m_pc.append_const_send_buffer(
metadata, metadata_piece_size);
}
virtual bool on_extended(int length