mirror of
https://github.com/transmission/transmission.git
synced 2026-02-15 07:26:49 +00:00
* chore: remove unused tr_announcerCreate() declaration added ind27c4c5but never used * chore: remove unused ParserStack::parentType() added in5efec26but never used * chore: remove tr_port::set_network() added in32f854abut never used * chore: remove tr_torrent_metainfo::pieces_offset() added in52f6e80but never used * chore: remove unused `tr_session::setPeerCongestionAlgorithm()` unused after611d36achore: remove unused `tr_session::setAnnounceIP()` unused after611d36a
This commit is contained in:
@@ -83,8 +83,6 @@ public:
|
||||
virtual void upkeep() = 0;
|
||||
};
|
||||
|
||||
std::unique_ptr<tr_announcer> tr_announcerCreate(tr_session* session);
|
||||
|
||||
// --- For torrent customers
|
||||
|
||||
void tr_announcerChangeMyPort(tr_torrent* tor);
|
||||
|
||||
@@ -225,16 +225,6 @@ struct ParserStack
|
||||
return depth > 0 && stack[depth].parent_type == ParentType::Dict && (stack[depth].n_children_walked % 2) == 0;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr std::optional<ParentType> parentType() const
|
||||
{
|
||||
if (depth == 0)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
return stack[depth].parent_type;
|
||||
}
|
||||
|
||||
std::optional<ParentType> pop(tr_error& error)
|
||||
{
|
||||
if (depth == 0)
|
||||
|
||||
@@ -101,11 +101,6 @@ public:
|
||||
hport_ = hport;
|
||||
}
|
||||
|
||||
void set_network(uint16_t nport) noexcept
|
||||
{
|
||||
hport_ = ntohs(nport);
|
||||
}
|
||||
|
||||
[[nodiscard]] static std::pair<tr_port, std::byte const*> from_compact(std::byte const* compact) noexcept;
|
||||
|
||||
[[nodiscard]] constexpr auto operator<(tr_port const& that) const noexcept
|
||||
|
||||
@@ -746,11 +746,6 @@ public:
|
||||
return settings().peer_congestion_algorithm;
|
||||
}
|
||||
|
||||
void setPeerCongestionAlgorithm(std::string_view algorithm)
|
||||
{
|
||||
settings_.peer_congestion_algorithm = algorithm;
|
||||
}
|
||||
|
||||
void setSocketDiffServ(tr_socket_t sock, tr_address_type type) const
|
||||
{
|
||||
tr_netSetDiffServ(sock, settings_.peer_socket_diffserv, type);
|
||||
@@ -808,11 +803,6 @@ public:
|
||||
return settings().announce_ip;
|
||||
}
|
||||
|
||||
void setAnnounceIP(std::string_view ip)
|
||||
{
|
||||
settings_.announce_ip = ip;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool useAnnounceIP() const noexcept
|
||||
{
|
||||
return settings().announce_ip_enabled;
|
||||
|
||||
@@ -369,7 +369,6 @@ struct MetainfoHandler final : public transmission::benc::BasicHandler<MaxBencDe
|
||||
auto const n = std::size(value) / sizeof(tr_sha1_digest_t);
|
||||
tm_.pieces_.resize(n);
|
||||
std::copy_n(std::data(value), std::size(value), reinterpret_cast<char*>(std::data(tm_.pieces_)));
|
||||
tm_.pieces_offset_ = context.tokenSpan().first;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -164,11 +164,6 @@ public:
|
||||
return info_dict_offset_;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr auto pieces_offset() const noexcept
|
||||
{
|
||||
return pieces_offset_;
|
||||
}
|
||||
|
||||
// UTILS
|
||||
|
||||
[[nodiscard]] auto torrent_file(std::string_view torrent_dir = {}) const
|
||||
@@ -239,10 +234,6 @@ private:
|
||||
uint64_t info_dict_size_ = 0;
|
||||
uint64_t info_dict_offset_ = 0;
|
||||
|
||||
// Offset of the bencoded 'pieces' checksums subset of the bencoded data.
|
||||
// Used when loading piece checksums on demand.
|
||||
uint64_t pieces_offset_ = 0;
|
||||
|
||||
bool has_magnet_info_hash_ = false;
|
||||
bool is_private_ = false;
|
||||
bool is_v2_ = false;
|
||||
|
||||
@@ -128,7 +128,6 @@ TEST_F(TorrentMetainfoTest, AndroidTorrent)
|
||||
EXPECT_NE(nullptr, metainfo);
|
||||
EXPECT_EQ(336, metainfo->info_dict_offset());
|
||||
EXPECT_EQ(26583, metainfo->info_dict_size());
|
||||
EXPECT_EQ(592, metainfo->pieces_offset());
|
||||
tr_ctorFree(ctor);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user