implement cancelTransfer and update transfer module for debug log

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@722 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
ewensun 2008-09-08 14:04:10 +00:00
parent 787159debe
commit 7b609a6aea
3 changed files with 110 additions and 75 deletions

View file

@ -70,6 +70,11 @@ public:
class peerInfo
{
public:
peerInfo(std::string peerId_in):peerId(peerId_in),state(PQIPEER_NOT_ONLINE),desiredRate(0),actualRate(0),
offset(0),chunkSize(TRANSFER_START_MIN),receivedSize(0),lastTS(0)
{
return;
}
peerInfo(std::string peerId_in,uint32_t state_in,uint32_t maxRate_in):
peerId(peerId_in),state(state_in),desiredRate(maxRate_in),actualRate(0),
offset(0),chunkSize(TRANSFER_START_MIN),receivedSize(0),lastTS(0)
@ -120,7 +125,7 @@ public:
class ftTransferModule
{
public:
ftTransferModule(ftFileCreator *fc, ftDataMultiplex *dm);
ftTransferModule(ftFileCreator *fc, ftDataMultiplex *dm, ftController *fc);
~ftTransferModule();
//interface to download controller
@ -155,14 +160,15 @@ private:
/* These have independent Mutexes / are const locally (no Mutex protection)*/
ftFileCreator *mFileCreator;
ftDataMultiplex *mMultiplexor;
ftController *mFtController;
std::string mHash;
uint64_t mSize;
RsMutex tfMtx; /* below is mutex protected */
std::list<std::string> mFileSources;
std::map<std::string,peerInfo> mOnlinePeers;
std::list<std::string> mOnlinePeers;
std::map<std::string,peerInfo> mFileSources;
bool mFlag; //1:transfer complete, 0: not complete
double desiredRate;