mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-15 12:32:37 -04:00
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:
parent
c845e40aa8
commit
3af7d41d7f
5 changed files with 31 additions and 15 deletions
|
@ -322,7 +322,7 @@ bool ftController::FileControl(std::string hash, uint32_t flags)
|
||||||
switch (flags)
|
switch (flags)
|
||||||
{
|
{
|
||||||
case RS_FILE_CTRL_PAUSE:
|
case RS_FILE_CTRL_PAUSE:
|
||||||
ft->stopTransfer();
|
ft->pauseTransfer();
|
||||||
break;
|
break;
|
||||||
case RS_FILE_CTRL_START:
|
case RS_FILE_CTRL_START:
|
||||||
ft->resumeTransfer();
|
ft->resumeTransfer();
|
||||||
|
|
|
@ -372,6 +372,8 @@ void *do_server_test_thread(void *data)
|
||||||
/************************* TEST 2 **********************
|
/************************* TEST 2 **********************
|
||||||
* test ftController and ftTransferModule
|
* test ftController and ftTransferModule
|
||||||
*/
|
*/
|
||||||
|
ftServer *server=mFt->loadServer;
|
||||||
|
|
||||||
std::string fname,filehash,destination;
|
std::string fname,filehash,destination;
|
||||||
uint32_t size,flags;
|
uint32_t size,flags;
|
||||||
std::list<std::string> srcIds;
|
std::list<std::string> srcIds;
|
||||||
|
@ -383,13 +385,23 @@ void *do_server_test_thread(void *data)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<ftServer *>iterator it;
|
DirDetails details;
|
||||||
it=(mFt->otherServers).front();
|
uint32_t flags = DIR_FLAGS_DETAILS | DIR_FLAGS_REMOTE;
|
||||||
ftServer* peerServer= (*it);
|
void *ref = NULL;
|
||||||
|
|
||||||
fname=;
|
if(!server->RequestDirDetails(ref,details,flags))
|
||||||
|
{
|
||||||
|
REPORT2(false,"fail to call RequestDirDetails");
|
||||||
|
}
|
||||||
|
|
||||||
mFt->loadServer->FileRequest(fname,filehash,filesize,destination,flags,srcIds);
|
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);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,7 +184,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostringstream pname;
|
std::ostringstream pname;
|
||||||
pname << "./tmp/rstst-" << time(NULL);
|
pname << "/tmp/rstst-" << time(NULL);
|
||||||
|
|
||||||
std::string basepath = pname.str();
|
std::string basepath = pname.str();
|
||||||
RsDirUtil::checkCreateDirectory(basepath);
|
RsDirUtil::checkCreateDirectory(basepath);
|
||||||
|
|
|
@ -25,11 +25,12 @@
|
||||||
|
|
||||||
#include "fttransfermodule.h"
|
#include "fttransfermodule.h"
|
||||||
|
|
||||||
ftTransferModule::ftTransferModule(ftFileCreator *fc, ftDataMultiplex *dm, ftController *fc)
|
ftTransferModule::ftTransferModule(ftFileCreator *fc, ftDataMultiplex *dm, ftController *c)
|
||||||
:mFileCreator(fc), mMultiplexor(dm), mFtController(fc), mFlag(0)
|
:mFileCreator(fc), mMultiplexor(dm), mFtController(c), mFlag(0)
|
||||||
{
|
{
|
||||||
mHash = mFileCreator->getHash();
|
mHash = mFileCreator->getHash();
|
||||||
mSize = mFileCreator->getFileSize();
|
mSize = mFileCreator->getFileSize();
|
||||||
|
mFileStatus.hash = mHash;
|
||||||
|
|
||||||
// Dummy for Testing (should be handled independantly for
|
// Dummy for Testing (should be handled independantly for
|
||||||
// each peer.
|
// each peer.
|
||||||
|
@ -47,8 +48,8 @@ bool ftTransferModule::setFileSources(std::list<std::string> peerIds)
|
||||||
std::list<std::string>::iterator it;
|
std::list<std::string>::iterator it;
|
||||||
for(it = peerIds.begin(); it != peerIds.end(); it++)
|
for(it = peerIds.begin(); it != peerIds.end(); it++)
|
||||||
{
|
{
|
||||||
peerInfo pInfo;
|
peerInfo pInfo(*it);
|
||||||
mFileSources.insert(pair<std::string,peerInfo>(*it,pInfo));
|
mFileSources.insert(std::pair<std::string,peerInfo>(*it,pInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -335,7 +336,7 @@ bool ftTransferModule::cancelTransfer()
|
||||||
|
|
||||||
bool ftTransferModule::completeFileTransfer()
|
bool ftTransferModule::completeFileTransfer()
|
||||||
{
|
{
|
||||||
mFtController->completeFile(mHash);
|
//mFtController->completeFile(mHash);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
|
|
||||||
#include "ft/ftfilecreator.h"
|
#include "ft/ftfilecreator.h"
|
||||||
#include "ft/ftdatamultiplex.h"
|
#include "ft/ftdatamultiplex.h"
|
||||||
|
#include "ft/ftcontroller.h"
|
||||||
|
|
||||||
#include "util/rsthreads.h"
|
#include "util/rsthreads.h"
|
||||||
|
|
||||||
|
@ -98,6 +99,7 @@ public:
|
||||||
|
|
||||||
class ftFileStatus
|
class ftFileStatus
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
enum Status {
|
enum Status {
|
||||||
PQIFILE_INIT,
|
PQIFILE_INIT,
|
||||||
PQIFILE_NOT_ONLINE,
|
PQIFILE_NOT_ONLINE,
|
||||||
|
@ -113,7 +115,8 @@ class ftFileStatus
|
||||||
PQIFILE_FAIL_NOT_READ,
|
PQIFILE_FAIL_NOT_READ,
|
||||||
PQIFILE_FAIL_BAD_PATH
|
PQIFILE_FAIL_BAD_PATH
|
||||||
};
|
};
|
||||||
public:
|
|
||||||
|
ftFileStatus():hash(0),stat(PQIFILE_INIT) {}
|
||||||
ftFileStatus(std::string hash_in):hash(hash_in),stat(PQIFILE_INIT)
|
ftFileStatus(std::string hash_in):hash(hash_in),stat(PQIFILE_INIT)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue