mirror of
https://github.com/transmission/transmission.git
synced 2026-04-02 00:27:38 +01:00
refactor: TCP segment payloads at least 128 bytes (#8745)
This commit is contained in:
@@ -109,9 +109,15 @@ std::shared_ptr<tr_peerIo> tr_peerIo::create(
|
||||
io->flush_outbuf_trigger_->set_callback(
|
||||
[weak = io->weak_from_this()]
|
||||
{
|
||||
// https://github.com/transmission/transmission/issues/7307
|
||||
static auto constexpr MinPayloadSize = 128U;
|
||||
|
||||
if (auto const ptr = weak.lock())
|
||||
{
|
||||
ptr->try_write(SIZE_MAX);
|
||||
if (ptr->outbuf_.size() >= MinPayloadSize)
|
||||
{
|
||||
ptr->try_write(SIZE_MAX);
|
||||
}
|
||||
}
|
||||
});
|
||||
tr_logAddTraceIo(io, fmt::format("bandwidth is {}; its parent is {}", fmt::ptr(&io->bandwidth()), fmt::ptr(parent)));
|
||||
|
||||
Reference in New Issue
Block a user