Added log message when checksum validation failed.

pull/1/head
Tatsuhiro Tsujikawa 2011-07-28 00:00:01 +09:00
parent 4ea28cb837
commit 932c258755
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,8 @@
#include "FileEntry.h"
#include "BitfieldMan.h"
#include "DownloadContext.h"
#include "LogFactory.h"
#include "fmt.h"
namespace aria2 {
@ -77,6 +79,8 @@ void IteratableChecksumValidator::validateChunk()
if(dctx_->getDigest() == actualDigest) {
pieceStorage_->markAllPiecesDone();
} else {
A2_LOG_INFO(fmt("Checksum validation failed. expected=%s, actual=%s",
dctx_->getDigest().c_str(), actualDigest.c_str()));
BitfieldMan bitfield(dctx_->getPieceLength(), dctx_->getTotalLength());
pieceStorage_->setBitfield(bitfield.getBitfield(), bitfield.getBitfieldLength());
}