mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
@@ -50,7 +50,7 @@ bool tr_handshake::build_handshake_message(tr_peerIo* io, uint8_t* buf) const
|
|||||||
}
|
}
|
||||||
auto const flag_bytes = flags.raw();
|
auto const flag_bytes = flags.raw();
|
||||||
|
|
||||||
auto* walk = buf;
|
[[maybe_unused]] auto* walk = buf;
|
||||||
walk = std::copy_n(reinterpret_cast<uint8_t const*>(std::data(HandshakeName)), std::size(HandshakeName), walk);
|
walk = std::copy_n(reinterpret_cast<uint8_t const*>(std::data(HandshakeName)), std::size(HandshakeName), walk);
|
||||||
walk = std::copy(std::begin(flag_bytes), std::end(flag_bytes), walk);
|
walk = std::copy(std::begin(flag_bytes), std::end(flag_bytes), walk);
|
||||||
walk = std::copy_n(reinterpret_cast<char const*>(std::data(info_hash)), std::size(info_hash), walk);
|
walk = std::copy_n(reinterpret_cast<char const*>(std::data(info_hash)), std::size(info_hash), walk);
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ size_t tr_peerIo::try_write(size_t max)
|
|||||||
return n_written;
|
return n_written;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tr_peerIo::event_write_cb(evutil_socket_t fd, short /*event*/, void* vio)
|
void tr_peerIo::event_write_cb([[maybe_unused]] evutil_socket_t fd, short /*event*/, void* vio)
|
||||||
{
|
{
|
||||||
auto* const io = static_cast<tr_peerIo*>(vio);
|
auto* const io = static_cast<tr_peerIo*>(vio);
|
||||||
tr_logAddTraceIo(io, "libevent says this peer socket is ready for writing");
|
tr_logAddTraceIo(io, "libevent says this peer socket is ready for writing");
|
||||||
@@ -415,7 +415,7 @@ size_t tr_peerIo::try_read(size_t max)
|
|||||||
return n_read;
|
return n_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tr_peerIo::event_read_cb(evutil_socket_t fd, short /*event*/, void* vio)
|
void tr_peerIo::event_read_cb([[maybe_unused]] evutil_socket_t fd, short /*event*/, void* vio)
|
||||||
{
|
{
|
||||||
static auto constexpr MaxLen = RcvBuf;
|
static auto constexpr MaxLen = RcvBuf;
|
||||||
|
|
||||||
|
|||||||
@@ -1279,12 +1279,12 @@ void tr_session::closeImplPart2(std::promise<void>* closed_promise, std::chrono:
|
|||||||
|
|
||||||
this->announcer_.reset();
|
this->announcer_.reset();
|
||||||
this->announcer_udp_.reset();
|
this->announcer_udp_.reset();
|
||||||
this->udp_core_.reset();
|
|
||||||
|
|
||||||
stats().saveIfDirty();
|
stats().saveIfDirty();
|
||||||
peer_mgr_.reset();
|
peer_mgr_.reset();
|
||||||
tr_utpClose(this);
|
|
||||||
openFiles().closeAll();
|
openFiles().closeAll();
|
||||||
|
tr_utpClose(this);
|
||||||
|
this->udp_core_.reset();
|
||||||
|
|
||||||
// tada we are done!
|
// tada we are done!
|
||||||
closed_promise->set_value();
|
closed_promise->set_value();
|
||||||
|
|||||||
@@ -1126,6 +1126,7 @@ private:
|
|||||||
tr_session_alt_speeds alt_speeds_{ alt_speed_mediator_ };
|
tr_session_alt_speeds alt_speeds_{ alt_speed_mediator_ };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// depends-on: udp_core_
|
||||||
struct struct_utp_context* utp_context = nullptr;
|
struct struct_utp_context* utp_context = nullptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -1141,7 +1142,7 @@ public:
|
|||||||
std::unique_ptr<Cache> cache = std::make_unique<Cache>(torrents_, 1024 * 1024 * 2);
|
std::unique_ptr<Cache> cache = std::make_unique<Cache>(torrents_, 1024 * 1024 * 2);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// depends-on: timer_maker_, top_bandwidth_, utp_comntext, torrents_, web_
|
// depends-on: timer_maker_, top_bandwidth_, utp_context, torrents_, web_
|
||||||
std::unique_ptr<struct tr_peerMgr, void (*)(struct tr_peerMgr*)> peer_mgr_;
|
std::unique_ptr<struct tr_peerMgr, void (*)(struct tr_peerMgr*)> peer_mgr_;
|
||||||
|
|
||||||
// depends-on: peer_mgr_, advertised_peer_port_, torrents_
|
// depends-on: peer_mgr_, advertised_peer_port_, torrents_
|
||||||
|
|||||||
Reference in New Issue
Block a user