mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
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:
parent
12536efd16
commit
08065b4298
22 changed files with 264 additions and 299 deletions
|
@ -947,12 +947,20 @@ int FileIndex::saveIndex(std::string filename, std::string &fileHash, uint64_t &
|
|||
std::map<std::string, DirEntry *>::iterator it;
|
||||
for(it = root->subdirs.begin(); it != root->subdirs.end(); it++)
|
||||
{
|
||||
#ifdef FI_DEBUG
|
||||
std::cout << "writting root directory: name=" << it->second->name << ", path=" << it->second->path << std::endl ;
|
||||
#endif
|
||||
if(forbidden_dirs.find(it->second->name) != forbidden_dirs.end())
|
||||
{
|
||||
#ifdef FI_DEBUG
|
||||
std::cerr << " will be suppressed." << std::endl ;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef FI_DEBUG
|
||||
std::cerr << " will be saved." << std::endl ;
|
||||
#endif
|
||||
(it->second)->saveEntry(oss);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -431,6 +431,7 @@ bool ftExtraList::loadList(std::list<RsItem *> load)
|
|||
}
|
||||
|
||||
fclose(fd);
|
||||
fd = NULL ;
|
||||
|
||||
if (ts > (time_t)fi->file.age)
|
||||
{
|
||||
|
|
|
@ -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): ";
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
|
||||
#include "serialiser/rsconfigitems.h"
|
||||
|
||||
/*
|
||||
#define CONFIG_DEBUG 1
|
||||
*/
|
||||
#define BACKEDUP_SAVE
|
||||
|
||||
|
||||
|
@ -184,8 +186,8 @@ bool p3ConfigMgr::backedUpFileSave(const std::string& fname, const std::string&
|
|||
const std::string& sign_fname_backup, BinMemInterface* configbio, BinMemInterface* signbio){
|
||||
|
||||
FILE *file = NULL, *sign = NULL;
|
||||
char *config_buff, *sign_buff;
|
||||
int size_file, size_sign;
|
||||
char *config_buff=NULL, *sign_buff=NULL;
|
||||
int size_file=0, size_sign=0;
|
||||
|
||||
// begin two pass saving by writing to back up file instead
|
||||
if (!configbio->writetofile(fname_backup.c_str()) || !signbio->writetofile(sign_fname_backup.c_str()))
|
||||
|
@ -665,7 +667,7 @@ bool p3Config::backedUpFileSave(const std::string& cfg_fname, const std::string&
|
|||
uint32_t stream_flags = BIN_FLAGS_WRITEABLE;
|
||||
bool written = true;
|
||||
FILE* cfg_file = NULL;
|
||||
char* buff;
|
||||
char* buff=NULL;
|
||||
int size_file = 0;
|
||||
|
||||
if (!cleanup)
|
||||
|
|
|
@ -138,7 +138,7 @@ class RsConfig
|
|||
firewalled = forwardPort = false ;
|
||||
maxDownloadDataRate = maxUploadDataRate = maxIndivDataRate = 0 ;
|
||||
promptAtBoot = 0 ;
|
||||
DHTActive = uPnPActive = netLocalOk = netDhtOk = netStunOk = netExtraAddressOk = false ;
|
||||
DHTActive = uPnPActive = netLocalOk = netUpnpOk = netDhtOk = netStunOk = netExtraAddressOk = false ;
|
||||
uPnPState = DHTPeers = 0 ;
|
||||
}
|
||||
std::string ownId;
|
||||
|
|
|
@ -594,15 +594,17 @@ void p3ChatService::sendAvatarJpegData(const std::string& peer_id)
|
|||
|
||||
// take avatar, and embed it into a std::wstring.
|
||||
//
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "p3ChatService::sending avatar image to peer" << peer_id << ", image size = " << ci->image_size << std::endl ;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
sendItem(ci) ;
|
||||
}
|
||||
else {
|
||||
#ifdef CHAT_DEBUG
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "Doing nothing" << std::endl ;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -423,6 +423,7 @@ void p3Ranking::addRankMsg(RsRankLinkMsg *msg)
|
|||
RankGroup grp;
|
||||
grp.rid = rid;
|
||||
grp.ownTag = false;
|
||||
grp.rank = 0.0f;
|
||||
|
||||
/*************************************************************************/
|
||||
/****************************** LINK SPECIFIC ****************************/
|
||||
|
@ -438,7 +439,6 @@ void p3Ranking::addRankMsg(RsRankLinkMsg *msg)
|
|||
mData[rid] = grp;
|
||||
it = mData.find(rid);
|
||||
|
||||
|
||||
if (id == "")
|
||||
{
|
||||
#ifdef RANK_DEBUG
|
||||
|
|
|
@ -95,6 +95,7 @@ RsQueueThread::RsQueueThread(uint32_t min, uint32_t max, double relaxFactor )
|
|||
:mMinSleep(min), mMaxSleep(max), mRelaxFactor(relaxFactor)
|
||||
{
|
||||
mLastSleep = (uint32_t)mMinSleep ;
|
||||
mLastWork = time(NULL) ;
|
||||
}
|
||||
|
||||
void RsQueueThread::run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue