roll back to 725

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@727 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
ewensun 2008-09-11 10:33:43 +00:00
parent e8d21abdd5
commit cc41cbb708
2 changed files with 11 additions and 7 deletions

View File

@ -122,7 +122,7 @@ void ftController::checkDownloadQueue()
bool ftController::completeFile(std::string hash) bool ftController::completeFile(std::string hash)
{ {
#if 0 #if 1
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
@ -134,16 +134,17 @@ bool ftController::completeFile(std::string hash)
} }
/* check if finished */ /* check if finished */
if (!(it->second).mCreator->finished()) //if (!(it->second).mCreator->finished())
{ {
/* not done! */ /* not done! */
return false; //return false;
} }
ftFileControl *fc = &(it->second); ftFileControl *fc = &(it->second);
/* done - cleanup */ /* done - cleanup */
fc->mTransfer->done(); //fc->mTransfer->done();
mDataplex->removeTransferModule(fc->mTransfer->hash()); mDataplex->removeTransferModule(fc->mTransfer->hash());
delete fc->mTransfer; delete fc->mTransfer;
@ -152,7 +153,7 @@ bool ftController::completeFile(std::string hash)
delete fc->mCreator; delete fc->mCreator;
fc->mCreator = NULL; fc->mCreator = NULL;
fc->mState = COMPLETE; fc->mState = ftFileControl::COMPLETED;
/* switch map */ /* switch map */
mCompleted[fc->mHash] = *fc; mCompleted[fc->mHash] = *fc;

View File

@ -57,6 +57,8 @@ class ftFileControl
{ {
public: public:
enum {DOWNLOADING,COMPLETED};
ftFileControl(); ftFileControl();
ftFileControl(std::string fname, uint64_t size, std::string hash, ftFileControl(std::string fname, uint64_t size, std::string hash,
uint32_t flags, ftFileCreator *fc, ftTransferModule *tm); uint32_t flags, ftFileCreator *fc, ftTransferModule *tm);
@ -93,6 +95,7 @@ bool FileRequest(std::string fname, std::string hash,
bool FileCancel(std::string hash); bool FileCancel(std::string hash);
bool FileControl(std::string hash, uint32_t flags); bool FileControl(std::string hash, uint32_t flags);
bool FileClearCompleted(); bool FileClearCompleted();
bool completeFile(std::string hash);
/* get Details of File Transfers */ /* get Details of File Transfers */
bool FileDownloads(std::list<std::string> &hashs); bool FileDownloads(std::list<std::string> &hashs);
@ -132,7 +135,7 @@ virtual bool loadList(std::list<RsItem *> load);
/* RunTime Functions */ /* RunTime Functions */
void checkDownloadQueue(); void checkDownloadQueue();
bool completeFile(std::string hash); //bool completeFile(std::string hash);
/* pointers to other components */ /* pointers to other components */
@ -142,7 +145,7 @@ bool completeFile(std::string hash);
RsMutex ctrlMutex; RsMutex ctrlMutex;
std::list<FileInfo> incomingQueue; std::list<FileInfo> incomingQueue;
std::map<std::string, FileInfo> mCompleted; std::map<std::string, ftFileControl> mCompleted;
std::map<std::string, ftFileControl> mDownloads; std::map<std::string, ftFileControl> mDownloads;