More bugfixes ... got the basic channels file transfer working.

* Create channels directory correctly.
 * added File Transfers to Config List.
 * connected statusChange() monitor callback.
 * fixed file sources in transfermodule.
 * fixed up transfer restarts / sleeps.
 * enabled opening files read only.
 * disabled some of the debug.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@799 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-11-13 23:03:46 +00:00
parent b0d462c93e
commit fce83cb232
16 changed files with 322 additions and 229 deletions

View file

@ -7,7 +7,7 @@
#define FILE_DEBUG 1
#define CHUNK_MAX_AGE 30
#define CHUNK_MAX_AGE 20
/***********************************************************
@ -147,20 +147,19 @@ int ftFileCreator::initializeFileAttrs()
/*
* check if the file exists
* cant use FileProviders verion because that opens readonly.
*/
if (ftFileProvider::initializeFileAttrs())
{
return 1;
}
RsStackMutex stack(ftcMutex); /********** STACK LOCKED MTX ******/
if (fd)
return 1;
/*
* check if the file exists
*/
{
std::cerr << "ftFileCreator::initializeFileAttrs() opening w+b";
std::cerr << "ftFileCreator::initializeFileAttrs() trying (r+b) ";
std::cerr << std::endl;
}
@ -168,15 +167,28 @@ int ftFileCreator::initializeFileAttrs()
* attempt to open file
*/
fd = fopen(file_name.c_str(), "w+b");
fd = fopen(file_name.c_str(), "r+b");
if (!fd)
{
std::cerr << "ftFileCreator::initializeFileAttrs()";
std::cerr << " Failed to open (w+b): "<< file_name << std::endl;
return 0;
std::cerr << "ftFileCreator::initializeFileAttrs() Failed to open (r+b): ";
std::cerr << file_name << std::endl;
std::cerr << "ftFileCreator::initializeFileAttrs() opening w+b";
std::cerr << std::endl;
/* try opening for write */
fd = fopen(file_name.c_str(), "w+b");
if (!fd)
{
std::cerr << "ftFileCreator::initializeFileAttrs()";
std::cerr << " Failed to open (w+b): "<< file_name << std::endl;
return 0;
}
}
/*
* if it opened, find it's length
* move to the end