mirror of
https://github.com/transmission/transmission
synced 2025-01-31 11:23:40 +00:00
fixup! refactor: add BufferReader, BufferWriter::reserve_space() (#5513)
chore: remove tracer fmt::print() statements
This commit is contained in:
parent
51fd7056ba
commit
b08e17beef
1 changed files with 5 additions and 7 deletions
|
@ -201,13 +201,11 @@ public:
|
||||||
if (auto const n_read = recv(sockfd, reinterpret_cast<char*>(buf), n_bytes, 0); n_read >= 0)
|
if (auto const n_read = recv(sockfd, reinterpret_cast<char*>(buf), n_bytes, 0); n_read >= 0)
|
||||||
{
|
{
|
||||||
commit_space(n_read);
|
commit_space(n_read);
|
||||||
fmt::print("{:p} read {:d} bytes (of {:d}) from socket {:d}\n", fmt::ptr(this), n_read, n_bytes, sockfd);
|
|
||||||
return n_read;
|
return n_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto const err = sockerrno;
|
auto const err = sockerrno;
|
||||||
tr_error_set(error, err, tr_net_strerror(err));
|
tr_error_set(error, err, tr_net_strerror(err));
|
||||||
fmt::print("{:p} error {:s}\n", fmt::ptr(this), tr_net_strerror(err));
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -236,16 +234,16 @@ public:
|
||||||
return evbuffer_get_length(buf_.get());
|
return evbuffer_get_length(buf_.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
void drain(size_t n_bytes) override
|
|
||||||
{
|
|
||||||
evbuffer_drain(buf_.get(), n_bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] value_type const* data() const override
|
[[nodiscard]] value_type const* data() const override
|
||||||
{
|
{
|
||||||
return reinterpret_cast<value_type*>(evbuffer_pullup(buf_.get(), -1));
|
return reinterpret_cast<value_type*>(evbuffer_pullup(buf_.get(), -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void drain(size_t n_bytes) override
|
||||||
|
{
|
||||||
|
evbuffer_drain(buf_.get(), n_bytes);
|
||||||
|
}
|
||||||
|
|
||||||
virtual std::pair<value_type*, size_t> reserve_space(size_t n_bytes) override
|
virtual std::pair<value_type*, size_t> reserve_space(size_t n_bytes) override
|
||||||
{
|
{
|
||||||
auto iov = evbuffer_iovec{};
|
auto iov = evbuffer_iovec{};
|
||||||
|
|
Loading…
Reference in a new issue