remove unused flags parameter to send_buffer() and send_message() on peer_connections
This commit is contained in:
parent
ad540ead79
commit
28d5b7d427
|
@ -271,7 +271,6 @@ namespace libtorrent {
|
|||
template <typename... Args>
|
||||
void send_message(message_type const type
|
||||
, counters::stats_counter_t const counter
|
||||
, std::uint32_t flags
|
||||
, Args... args)
|
||||
{
|
||||
TORRENT_ASSERT(m_sent_handshake);
|
||||
|
@ -285,7 +284,7 @@ namespace libtorrent {
|
|||
int tmp[] = {0, (detail::write_int32(args, ptr), 0)...};
|
||||
TORRENT_UNUSED(tmp);
|
||||
|
||||
send_buffer(msg, flags);
|
||||
send_buffer(msg);
|
||||
|
||||
stats_counters().inc_stats_counter(counter);
|
||||
}
|
||||
|
|
|
@ -617,8 +617,7 @@ namespace aux {
|
|||
// value invalid (the default constructor).
|
||||
virtual piece_block_progress downloading_piece_progress() const;
|
||||
|
||||
enum message_type_flags { message_type_request = 1 };
|
||||
void send_buffer(span<char const> buf, std::uint32_t flags = 0);
|
||||
void send_buffer(span<char const> buf);
|
||||
void setup_send();
|
||||
|
||||
template <typename Holder>
|
||||
|
|
|
@ -100,7 +100,7 @@ struct TORRENT_EXPORT peer_connection_handle
|
|||
|
||||
bool in_handshake() const;
|
||||
|
||||
void send_buffer(char const* begin, int size, std::uint32_t flags = 0);
|
||||
void send_buffer(char const* begin, int size);
|
||||
|
||||
std::time_t last_seen_complete() const;
|
||||
time_point time_of_last_unchoke() const;
|
||||
|
|
|
@ -349,7 +349,7 @@ namespace {
|
|||
#ifndef TORRENT_DISABLE_LOGGING
|
||||
peer_log(peer_log_alert::outgoing_message, "HAVE_ALL");
|
||||
#endif
|
||||
send_message(msg_have_all, counters::num_outgoing_have_all, 0);
|
||||
send_message(msg_have_all, counters::num_outgoing_have_all);
|
||||
}
|
||||
|
||||
void bt_peer_connection::write_have_none()
|
||||
|
@ -359,7 +359,7 @@ namespace {
|
|||
#ifndef TORRENT_DISABLE_LOGGING
|
||||
peer_log(peer_log_alert::outgoing_message, "HAVE_NONE");
|
||||
#endif
|
||||
send_message(msg_have_none, counters::num_outgoing_have_none, 0);
|
||||
send_message(msg_have_none, counters::num_outgoing_have_none);
|
||||
}
|
||||
|
||||
void bt_peer_connection::write_reject_request(peer_request const& r)
|
||||
|
@ -376,7 +376,7 @@ namespace {
|
|||
, r.start, r.length);
|
||||
#endif
|
||||
|
||||
send_message(msg_reject_request, counters::num_outgoing_reject, 0
|
||||
send_message(msg_reject_request, counters::num_outgoing_reject
|
||||
, static_cast<int>(r.piece), r.start, r.length);
|
||||
}
|
||||
|
||||
|
@ -393,7 +393,7 @@ namespace {
|
|||
|
||||
TORRENT_ASSERT(associated_torrent().lock()->valid_metadata());
|
||||
|
||||
send_message(msg_allowed_fast, counters::num_outgoing_allowed_fast, 0
|
||||
send_message(msg_allowed_fast, counters::num_outgoing_allowed_fast
|
||||
, static_cast<int>(piece));
|
||||
}
|
||||
|
||||
|
@ -421,7 +421,7 @@ namespace {
|
|||
}
|
||||
#endif
|
||||
|
||||
send_message(msg_suggest_piece, counters::num_outgoing_suggest, 0
|
||||
send_message(msg_suggest_piece, counters::num_outgoing_suggest
|
||||
, static_cast<int>(piece));
|
||||
}
|
||||
|
||||
|
@ -1939,7 +1939,7 @@ namespace {
|
|||
{
|
||||
INVARIANT_CHECK;
|
||||
|
||||
send_message(msg_cancel, counters::num_outgoing_cancel, 0
|
||||
send_message(msg_cancel, counters::num_outgoing_cancel
|
||||
, static_cast<int>(r.piece), r.start, r.length);
|
||||
|
||||
if (!m_supports_fast) incoming_reject_request(r);
|
||||
|
@ -1949,7 +1949,7 @@ namespace {
|
|||
{
|
||||
INVARIANT_CHECK;
|
||||
|
||||
send_message(msg_request, counters::num_outgoing_request, message_type_request
|
||||
send_message(msg_request, counters::num_outgoing_request
|
||||
, static_cast<int>(r.piece), r.start, r.length);
|
||||
}
|
||||
|
||||
|
@ -2195,14 +2195,14 @@ namespace {
|
|||
INVARIANT_CHECK;
|
||||
|
||||
if (is_choked()) return;
|
||||
send_message(msg_choke, counters::num_outgoing_choke, 0);
|
||||
send_message(msg_choke, counters::num_outgoing_choke);
|
||||
}
|
||||
|
||||
void bt_peer_connection::write_unchoke()
|
||||
{
|
||||
INVARIANT_CHECK;
|
||||
|
||||
send_message(msg_unchoke, counters::num_outgoing_unchoke, 0);
|
||||
send_message(msg_unchoke, counters::num_outgoing_unchoke);
|
||||
|
||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||
for (auto const& e : m_extensions)
|
||||
|
@ -2216,14 +2216,14 @@ namespace {
|
|||
{
|
||||
INVARIANT_CHECK;
|
||||
|
||||
send_message(msg_interested, counters::num_outgoing_interested, 0);
|
||||
send_message(msg_interested, counters::num_outgoing_interested);
|
||||
}
|
||||
|
||||
void bt_peer_connection::write_not_interested()
|
||||
{
|
||||
INVARIANT_CHECK;
|
||||
|
||||
send_message(msg_not_interested, counters::num_outgoing_not_interested, 0);
|
||||
send_message(msg_not_interested, counters::num_outgoing_not_interested);
|
||||
}
|
||||
|
||||
void bt_peer_connection::write_have(piece_index_t const index)
|
||||
|
@ -2237,7 +2237,7 @@ namespace {
|
|||
// there instead
|
||||
if (!m_sent_bitfield) return;
|
||||
|
||||
send_message(msg_have, counters::num_outgoing_have, 0
|
||||
send_message(msg_have, counters::num_outgoing_have
|
||||
, static_cast<int>(index));
|
||||
}
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ namespace libtorrent {
|
|||
peer_log(peer_log_alert::outgoing_message, "REQUEST", "%s", request.c_str());
|
||||
#endif
|
||||
|
||||
send_buffer(request, message_type_request);
|
||||
send_buffer(request);
|
||||
}
|
||||
|
||||
// --------------------------
|
||||
|
|
|
@ -5726,10 +5726,9 @@ namespace libtorrent {
|
|||
return {};
|
||||
}
|
||||
|
||||
void peer_connection::send_buffer(span<char const> buf, std::uint32_t const flags)
|
||||
void peer_connection::send_buffer(span<char const> buf)
|
||||
{
|
||||
TORRENT_ASSERT(is_single_thread());
|
||||
TORRENT_UNUSED(flags);
|
||||
|
||||
int const free_space = std::min(
|
||||
m_send_buffer.space_in_last_buffer(), int(buf.size()));
|
||||
|
|
|
@ -278,12 +278,11 @@ bool peer_connection_handle::in_handshake() const
|
|||
return pc->in_handshake();
|
||||
}
|
||||
|
||||
void peer_connection_handle::send_buffer(char const* begin, int size
|
||||
, std::uint32_t const flags)
|
||||
void peer_connection_handle::send_buffer(char const* begin, int size)
|
||||
{
|
||||
std::shared_ptr<peer_connection> pc = native_handle();
|
||||
TORRENT_ASSERT(pc);
|
||||
pc->send_buffer({begin, size}, flags);
|
||||
pc->send_buffer({begin, size});
|
||||
}
|
||||
|
||||
std::time_t peer_connection_handle::last_seen_complete() const
|
||||
|
|
|
@ -463,7 +463,7 @@ void web_peer_connection::write_request(peer_request const& r)
|
|||
peer_log(peer_log_alert::outgoing_message, "REQUEST", "%s", request.c_str());
|
||||
#endif
|
||||
|
||||
send_buffer(request, message_type_request);
|
||||
send_buffer(request);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
|
Loading…
Reference in New Issue