ported branch v0.5.0 commits 2623, 2624, 2626, 2633, 2634, 2643, 2644, 2646, 2651 and 2654 to trunk

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2660 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-03-28 20:46:45 +00:00
parent 12536efd16
commit 08065b4298
22 changed files with 264 additions and 299 deletions

View file

@ -57,7 +57,6 @@
* #define CONTROL_DEBUG 1
* #define DEBUG_DWLQUEUE 1
*****/
#define DEBUG_DWLQUEUE 1
static const uint32_t SAVE_TRANSFERS_DELAY = 61 ; // save transfer progress every 61 seconds.
static const uint32_t INACTIVE_CHUNKS_CHECK_DELAY = 60 ; // time after which an inactive chunk is released

View file

@ -402,6 +402,7 @@ bool ftDataMultiplex::recvChunkMap(const std::string& peerId, const std::string&
std::cerr << "ftDataMultiplex::handleRecvChunkMap() ERROR: No matching file Provider for hash " << hash ;
std::cerr << std::endl;
#endif
return false;
}
it->second->setClientMap(peerId, compressed_map);

View file

@ -431,6 +431,7 @@ bool ftExtraList::loadList(std::list<RsItem *> load)
}
fclose(fd);
fd = NULL ;
if (ts > (time_t)fi->file.age)
{

View file

@ -8,7 +8,7 @@
static const time_t UPLOAD_CHUNK_MAPS_TIME = 30 ; // time to ask for a new chunkmap from uploaders in seconds.
ftFileProvider::ftFileProvider(std::string path, uint64_t size, std::string
hash) : mSize(size), hash(hash), file_name(path), fd(NULL),transfer_rate(0),total_size(0)
hash) : mSize(size), hash(hash), file_name(path), fd(NULL),transfer_rate(0),total_size(0),req_loc(0)
{
RsStackMutex stack(ftcMutex); /********** STACK LOCKED MTX ******/
clients_chunk_maps.clear();
@ -25,6 +25,7 @@ ftFileProvider::~ftFileProvider(){
#endif
if (fd!=NULL) {
fclose(fd);
fd = NULL ;
}
}
@ -239,7 +240,7 @@ int ftFileProvider::initializeFileAttrs()
* attempt to open file
*/
fd = fopen64(file_name.c_str(), "rb");
fd = fopen64(file_name.c_str(), "r+b");
if (!fd)
{
std::cerr << "ftFileProvider::initializeFileAttrs() Failed to open (r+b): ";