mirror of
https://github.com/transmission/transmission
synced 2025-03-06 19:48:15 +00:00
parent
a24679d89f
commit
9e07b6f4c5
1 changed files with 8 additions and 2 deletions
|
@ -89,8 +89,14 @@ int Cache::writeContiguous(CIter const begin, CIter const end) const
|
||||||
TR_ASSERT(std::size(buf) == buflen);
|
TR_ASSERT(std::size(buf) == buflen);
|
||||||
|
|
||||||
// save it
|
// save it
|
||||||
auto* const tor = torrents_.get(begin->key.first);
|
auto const& [torrent_id, block] = begin->key;
|
||||||
auto const loc = tor->blockLoc(begin->key.second);
|
auto* const tor = torrents_.get(torrent_id);
|
||||||
|
if (tor == nullptr)
|
||||||
|
{
|
||||||
|
return EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto const loc = tor->blockLoc(block);
|
||||||
|
|
||||||
if (auto const err = tr_ioWrite(tor, loc, std::size(buf), std::data(buf)); err != 0)
|
if (auto const err = tr_ioWrite(tor, loc, std::size(buf), std::data(buf)); err != 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue