mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
small bug fixes about CRC32 verification when the file is actually complete.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4662 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d43a131c04
commit
fa690de1d6
@ -352,7 +352,7 @@ void ChunkMap::setPeerAvailabilityMap(const std::string& peer_id,const Compresse
|
||||
uint32_t ChunkMap::sizeOfChunk(uint32_t cid) const
|
||||
{
|
||||
if(cid == _map.size()-1)
|
||||
return _file_size - (_map.size()-1)*_chunk_size ;
|
||||
return _file_size - cid*_chunk_size ;
|
||||
else
|
||||
return _chunk_size ;
|
||||
}
|
||||
|
@ -653,7 +653,6 @@ bool ftFileCreator::crossCheckChunkMap(const CRC32Map& ref,uint32_t& bad_chunks,
|
||||
|
||||
delete[] buff ;
|
||||
|
||||
if(bad_chunks > 0)
|
||||
chunkMap.setAvailabilityMap(map) ;
|
||||
}
|
||||
closeFile() ;
|
||||
|
@ -744,7 +744,10 @@ bool ftTransferModule::checkCRC()
|
||||
}
|
||||
else
|
||||
{
|
||||
mFlag = FT_TM_FLAG_COMPLETE ;
|
||||
// We do as if the file is not complete. This way, it finishes properly.
|
||||
//
|
||||
mFlag = FT_TM_FLAG_DOWNLOADING ;
|
||||
mFileStatus.stat = ftFileStatus::PQIFILE_DOWNLOADING;
|
||||
#ifdef FT_DEBUG
|
||||
std::cerr << "ftTransferModule::checkCRC(): Done. CRC check is ok, file is complete." << std::endl ;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user