MCPcopy Create free account
hub / github.com/aria2/aria2 / flushWrDiskCacheEntry

Function flushWrDiskCacheEntry

src/DownloadCommand.cc:115–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113
114namespace {
115void flushWrDiskCacheEntry(WrDiskCache* wrDiskCache,
116 const std::shared_ptr<Segment>& segment)
117{
118 const std::shared_ptr<Piece>& piece = segment->getPiece();
119 if (piece->getWrDiskCacheEntry()) {
120 piece->flushWrCache(wrDiskCache);
121 if (piece->getWrDiskCacheEntry()->getError() !=
122 WrDiskCacheEntry::CACHE_ERR_SUCCESS) {
123 segment->clear(wrDiskCache);
124 throw DOWNLOAD_FAILURE_EXCEPTION2(
125 fmt("Write disk cache flush failure index=%lu",
126 static_cast<unsigned long>(piece->getIndex())),
127 piece->getWrDiskCacheEntry()->getErrorCode());
128 }
129 }
130}
131} // namespace
132
133bool DownloadCommand::executeInternal()

Callers 1

completeSegmentMethod · 0.85

Calls 8

fmtFunction · 0.85
getWrDiskCacheEntryMethod · 0.80
flushWrCacheMethod · 0.80
getErrorMethod · 0.80
getPieceMethod · 0.45
clearMethod · 0.45
getIndexMethod · 0.45
getErrorCodeMethod · 0.45

Tested by

no test coverage detected