From cc41cbb708dc5e44f9171daadbd788381e13155f Mon Sep 17 00:00:00 2001 From: ewensun Date: Thu, 11 Sep 2008 10:33:43 +0000 Subject: [PATCH] roll back to 725 git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@727 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/ft/ftcontroller.cc | 11 ++++++----- libretroshare/src/ft/ftcontroller.h | 7 +++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index bd839fd0e..ad407e387 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -122,7 +122,7 @@ void ftController::checkDownloadQueue() bool ftController::completeFile(std::string hash) { -#if 0 +#if 1 RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ @@ -134,16 +134,17 @@ bool ftController::completeFile(std::string hash) } /* check if finished */ - if (!(it->second).mCreator->finished()) + //if (!(it->second).mCreator->finished()) { /* not done! */ - return false; + //return false; } + ftFileControl *fc = &(it->second); /* done - cleanup */ - fc->mTransfer->done(); + //fc->mTransfer->done(); mDataplex->removeTransferModule(fc->mTransfer->hash()); delete fc->mTransfer; @@ -152,7 +153,7 @@ bool ftController::completeFile(std::string hash) delete fc->mCreator; fc->mCreator = NULL; - fc->mState = COMPLETE; + fc->mState = ftFileControl::COMPLETED; /* switch map */ mCompleted[fc->mHash] = *fc; diff --git a/libretroshare/src/ft/ftcontroller.h b/libretroshare/src/ft/ftcontroller.h index 11bd6e15f..de5371930 100644 --- a/libretroshare/src/ft/ftcontroller.h +++ b/libretroshare/src/ft/ftcontroller.h @@ -57,6 +57,8 @@ class ftFileControl { public: + enum {DOWNLOADING,COMPLETED}; + ftFileControl(); ftFileControl(std::string fname, uint64_t size, std::string hash, 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 FileControl(std::string hash, uint32_t flags); bool FileClearCompleted(); +bool completeFile(std::string hash); /* get Details of File Transfers */ bool FileDownloads(std::list &hashs); @@ -132,7 +135,7 @@ virtual bool loadList(std::list load); /* RunTime Functions */ void checkDownloadQueue(); -bool completeFile(std::string hash); +//bool completeFile(std::string hash); /* pointers to other components */ @@ -142,7 +145,7 @@ bool completeFile(std::string hash); RsMutex ctrlMutex; std::list incomingQueue; - std::map mCompleted; + std::map mCompleted; std::map mDownloads;