bugfix with rehashing already shared files

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1694 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
alexandrut 2009-09-28 20:31:09 +00:00
parent a3e010b842
commit e929b419f4
2 changed files with 2 additions and 2 deletions

View File

@ -197,7 +197,7 @@ bool FileIndexMonitor::loadLocalCache(const CacheData &data) /* called with sto
std::string name = data.name ; // this trick allows to load the complete file. Not the one being shared.
name[name.length()-1] = 'c' ;
if ((ok = fi.loadIndex(data.path + '/' + data.name, data.hash, data.size)))
if ((ok = fi.loadIndex(data.path + '/' + name, "", data.size)))
{
#ifdef FIM_DEBUG
std::cerr << "FileIndexMonitor::loadCache() Success!";

View File

@ -731,7 +731,7 @@ int FileIndex::loadIndex(std::string filename, std::string expectedHash, uint64_
tmpout << std::setw(2) << std::setfill('0') << std::hex << (unsigned int) (sha_buf[i]);
}
if (expectedHash != tmpout.str())
if (expectedHash != "" && expectedHash != tmpout.str())
{
#ifdef FI_DEBUG
std::cerr << "FileIndex::loadIndex expected hash does not match" << std::endl;