diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index 0bf400237..6657e3409 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -195,12 +195,6 @@ namespace libtorrent policy::peer* peer_info_struct() const { return m_peer_info; } - // used by extensions to advertise that they expect to - // receive a number of bytes, this will make the peer - // connection request more download quota from the download - // rate limiter - void extension_expect_bytes(int n) { m_extension_outstanding_bytes += n; } - enum peer_speed_t { slow = 1, medium, fast }; peer_speed_t peer_speed(); diff --git a/src/metadata_transfer.cpp b/src/metadata_transfer.cpp index 5eed27b0c..b097c114a 100644 --- a/src/metadata_transfer.cpp +++ b/src/metadata_transfer.cpp @@ -287,8 +287,6 @@ 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); diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 8e2a870a3..50ae37986 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -4172,7 +4172,7 @@ namespace libtorrent TORRENT_ASSERT(m_outstanding_bytes >= 0); m_channel_state[download_channel] = peer_info::bw_limit; m_ses.m_download_rate.request_bandwidth(self() - , (std::max)(m_outstanding_bytes, m_extension_outstanding_bytes) + 30 + , (std::max)(m_outstanding_bytes, m_packet_size - m_recv_pos) + 30 , priority , bwc1, bwc2, bwc3, bwc4); } diff --git a/src/ut_metadata.cpp b/src/ut_metadata.cpp index 38ff1467d..25dc3011c 100644 --- a/src/ut_metadata.cpp +++ b/src/ut_metadata.cpp @@ -324,7 +324,6 @@ namespace libtorrent { namespace if (!m_torrent.valid_metadata()) { write_metadata_packet(2, piece); - m_pc.extension_expect_bytes(0x4000); return true; } // TODO: put the request on the queue in some cases