mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed up a few debug messages in p3filelists
This commit is contained in:
parent
bb4b577768
commit
068955d419
@ -982,7 +982,7 @@ bool InternalFileHierarchyStorage::load(const std::string& fname)
|
||||
mNodes.clear();
|
||||
mNodes.resize(n_nodes,NULL) ;
|
||||
|
||||
for(uint32_t i=0;i<mNodes.size();++i)
|
||||
for(uint32_t i=0;i<mNodes.size() && buffer_offset < buffer_size;++i) // only the 2nd condition really is needed. The first one ensures that the loop wont go forever.
|
||||
{
|
||||
unsigned char *node_section_data = NULL ;
|
||||
uint32_t node_section_size = 0 ;
|
||||
|
@ -151,7 +151,7 @@ bool FileListIO::saveEncryptedDataToFile(const std::string& fname,const unsigned
|
||||
|
||||
if(!AuthSSL::getAuthSSL()->encrypt( encryptedData, encDataLen, data,total_size, AuthSSL::getAuthSSL()->OwnId()))
|
||||
{
|
||||
std::cerr << "Cannot encrypt hash cache. Something's wrong." << std::endl;
|
||||
std::cerr << "Cannot encrypt encrypted file. Something's wrong." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -159,14 +159,14 @@ bool FileListIO::saveEncryptedDataToFile(const std::string& fname,const unsigned
|
||||
|
||||
if(!F)
|
||||
{
|
||||
std::cerr << "Cannot open encrypted file cache for writing: " << fname+".tmp" << std::endl;
|
||||
std::cerr << "Cannot open encrypted file for writing: " << fname+".tmp" << std::endl;
|
||||
|
||||
free(encryptedData);
|
||||
return false;
|
||||
}
|
||||
if(fwrite(encryptedData,1,encDataLen,F) != (uint32_t)encDataLen)
|
||||
{
|
||||
std::cerr << "Could not write entire encrypted hash cache file. Out of disc space??" << std::endl;
|
||||
std::cerr << "Could not write entire encrypted file. Out of disc space??" << std::endl;
|
||||
fclose(F) ;
|
||||
|
||||
free(encryptedData);
|
||||
@ -190,7 +190,7 @@ bool FileListIO::loadEncryptedDataFromFile(const std::string& fname,unsigned cha
|
||||
|
||||
if(!RsDirUtil::checkFile( fname,file_size,false ) )
|
||||
{
|
||||
std::cerr << "Encrypted hash cache file not present." << std::endl;
|
||||
std::cerr << "Encrypted file " << fname << " not available." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ bool FileListIO::loadEncryptedDataFromFile(const std::string& fname,unsigned cha
|
||||
FILE *F = fopen( fname.c_str(),"rb") ;
|
||||
if (!F)
|
||||
{
|
||||
std::cerr << "Cannot open file for reading encrypted file cache, filename " << fname << std::endl;
|
||||
std::cerr << "Cannot open encrypted file, filename " << fname << std::endl;
|
||||
return false;
|
||||
}
|
||||
if(fread(buffer,1,file_size,F) != file_size)
|
||||
@ -221,7 +221,7 @@ bool FileListIO::loadEncryptedDataFromFile(const std::string& fname,unsigned cha
|
||||
|
||||
if(!AuthSSL::getAuthSSL()->decrypt(decrypted_data, decrypted_data_size, buffer, file_size))
|
||||
{
|
||||
std::cerr << "Cannot decrypt encrypted file cache. Something's wrong." << std::endl;
|
||||
std::cerr << "Cannot decrypt encrypted file. Something's wrong." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1262,7 +1262,9 @@ void p3FileDatabase::handleDirSyncResponse(RsFileListsSyncResponseItem *sitem)
|
||||
RS_STACK_MUTEX(mFLSMtx) ;
|
||||
fi = locked_getFriendIndex(item->PeerId());
|
||||
|
||||
std::cerr << " friend index is " << fi ;
|
||||
#ifdef DEBUG_P3FILELISTS
|
||||
P3FILELISTS_DEBUG() << " friend index is " << fi ;
|
||||
#endif
|
||||
|
||||
// make sure we have a remote directory for that friend.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user