solve compile faults.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@725 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
ewensun 2008-09-09 13:08:22 +00:00
parent c845e40aa8
commit 3af7d41d7f
5 changed files with 31 additions and 15 deletions

View File

@ -322,7 +322,7 @@ bool ftController::FileControl(std::string hash, uint32_t flags)
switch (flags)
{
case RS_FILE_CTRL_PAUSE:
ft->stopTransfer();
ft->pauseTransfer();
break;
case RS_FILE_CTRL_START:
ft->resumeTransfer();

View File

@ -372,6 +372,8 @@ void *do_server_test_thread(void *data)
/************************* TEST 2 **********************
* test ftController and ftTransferModule
*/
ftServer *server=mFt->loadServer;
std::string fname,filehash,destination;
uint32_t size,flags;
std::list<std::string> srcIds;
@ -382,14 +384,24 @@ void *do_server_test_thread(void *data)
REPORT2(false,"No otherServers available");
exit(1);
}
std::list<ftServer *>iterator it;
it=(mFt->otherServers).front();
ftServer* peerServer= (*it);
fname=;
mFt->loadServer->FileRequest(fname,filehash,filesize,destination,flags,srcIds);
DirDetails details;
uint32_t flags = DIR_FLAGS_DETAILS | DIR_FLAGS_REMOTE;
void *ref = NULL;
if(!server->RequestDirDetails(ref,details,flags))
{
REPORT2(false,"fail to call RequestDirDetails");
}
if (details.type == DIR_TYPE_FILE)
{
REPORT("RemoteDirModel::downloadSelected() Calling File Request");
std::list<std::string> srcIds;
srcIds.push_back(details.id);
server->FileRequest(details.name, details.hash,
details.count, "", 0, srcIds);
}
exit(1);
}

View File

@ -184,7 +184,7 @@ int main(int argc, char **argv)
}
std::ostringstream pname;
pname << "./tmp/rstst-" << time(NULL);
pname << "/tmp/rstst-" << time(NULL);
std::string basepath = pname.str();
RsDirUtil::checkCreateDirectory(basepath);

View File

@ -25,11 +25,12 @@
#include "fttransfermodule.h"
ftTransferModule::ftTransferModule(ftFileCreator *fc, ftDataMultiplex *dm, ftController *fc)
:mFileCreator(fc), mMultiplexor(dm), mFtController(fc), mFlag(0)
ftTransferModule::ftTransferModule(ftFileCreator *fc, ftDataMultiplex *dm, ftController *c)
:mFileCreator(fc), mMultiplexor(dm), mFtController(c), mFlag(0)
{
mHash = mFileCreator->getHash();
mSize = mFileCreator->getFileSize();
mFileStatus.hash = mHash;
// Dummy for Testing (should be handled independantly for
// each peer.
@ -47,8 +48,8 @@ bool ftTransferModule::setFileSources(std::list<std::string> peerIds)
std::list<std::string>::iterator it;
for(it = peerIds.begin(); it != peerIds.end(); it++)
{
peerInfo pInfo;
mFileSources.insert(pair<std::string,peerInfo>(*it,pInfo));
peerInfo pInfo(*it);
mFileSources.insert(std::pair<std::string,peerInfo>(*it,pInfo));
}
return true;
@ -335,7 +336,7 @@ bool ftTransferModule::cancelTransfer()
bool ftTransferModule::completeFileTransfer()
{
mFtController->completeFile(mHash);
//mFtController->completeFile(mHash);
return true;
}

View File

@ -41,6 +41,7 @@
#include "ft/ftfilecreator.h"
#include "ft/ftdatamultiplex.h"
#include "ft/ftcontroller.h"
#include "util/rsthreads.h"
@ -98,6 +99,7 @@ public:
class ftFileStatus
{
public:
enum Status {
PQIFILE_INIT,
PQIFILE_NOT_ONLINE,
@ -113,7 +115,8 @@ class ftFileStatus
PQIFILE_FAIL_NOT_READ,
PQIFILE_FAIL_BAD_PATH
};
public:
ftFileStatus():hash(0),stat(PQIFILE_INIT) {}
ftFileStatus(std::string hash_in):hash(hash_in),stat(PQIFILE_INIT)
{
return;