mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
removed duplicate hashing function. Now the hash buffer is always 512 bytes.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4038 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
acf536317f
commit
9de341953d
5 changed files with 13 additions and 80 deletions
|
@ -278,6 +278,8 @@ int ftFileCreator::locked_initializeFileAttrs()
|
|||
}
|
||||
ftFileCreator::~ftFileCreator()
|
||||
{
|
||||
std::cerr << "Deleting file creator for " << file_name << std::endl;
|
||||
|
||||
// Note: The file is actually closed in the parent, that is always a ftFileProvider.
|
||||
//
|
||||
/*
|
||||
|
@ -495,6 +497,7 @@ bool ftFileCreator::finished()
|
|||
|
||||
bool ftFileCreator::hashReceivedData(std::string& hash)
|
||||
{
|
||||
std::cerr << "file creator " << hash << " asked for hashing received data " << file_name << std::endl;
|
||||
// csoler: No mutex here please !
|
||||
//
|
||||
// This is a bit dangerous, but otherwise we might stuck the GUI for a
|
||||
|
@ -502,9 +505,13 @@ bool ftFileCreator::hashReceivedData(std::string& hash)
|
|||
// at a time file_name nor hash can be modified, which is easy.
|
||||
//
|
||||
if(!finished())
|
||||
{
|
||||
std::cerr << "Transfer not finished !! This should not happen" << std::endl;
|
||||
return false ;
|
||||
}
|
||||
|
||||
return RsDirUtil::hashFile(file_name,hash) ;
|
||||
uint64_t tmpsize ;
|
||||
return RsDirUtil::getFileHash(file_name,hash,tmpsize) ;
|
||||
}
|
||||
|
||||
bool ftFileCreator::crossCheckChunkMap(const CRC32Map& ref,uint32_t& bad_chunks,uint32_t& incomplete_chunks)
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
/******
|
||||
* #define FT_DEBUG 1
|
||||
*****/
|
||||
#define FT_DEBUG 1
|
||||
|
||||
#include "retroshare/rsturtle.h"
|
||||
#include "fttransfermodule.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue