mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 02:55:18 -04:00
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:
parent
b0d462c93e
commit
fce83cb232
16 changed files with 322 additions and 229 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue