mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-27 07:41:08 -04:00
Merged branch commits:
3068: added verification for file size computation (bug correction) 3069: set heartbeat values to intermediate values 3070: suppressed uninitialised memory read 3071: automatic removal of file lists from deleted peers, at restart (After double check that this does not alter exchange of file lists in any way) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3072 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0470477bcc
commit
7b0757c4bc
9 changed files with 73 additions and 39 deletions
|
@ -724,12 +724,22 @@ bool p3Config::backedUpFileSave(const std::string& cfg_fname, const std::string&
|
|||
cfg_file = fopen(cfg_fname.c_str(), "wb");
|
||||
|
||||
if(cfg_file == NULL)
|
||||
{
|
||||
std::cerr << "p3Config::backedUpFileSave() fopen failed for file:" << cfg_fname << std::endl;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
//determine file size
|
||||
fseek(cfg_file, 0L, SEEK_END);
|
||||
size_file = ftell(cfg_file);
|
||||
|
||||
if(size_file < 0) // ftell returns -1 when fails
|
||||
{
|
||||
fclose(cfg_file);
|
||||
size_file = 0 ;
|
||||
}
|
||||
|
||||
fseek(cfg_file, 0L, SEEK_SET);
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
|
|
@ -115,7 +115,7 @@ int pqiperson::tick()
|
|||
//if lastHeartbeatReceived is 0, it might be not activated so don't do a net reset.
|
||||
if (active &&
|
||||
lastHeartbeatReceived != 0 &&
|
||||
(time(NULL) - lastHeartbeatReceived) > HEARTBEAT_REPEAT_TIME * 10) {
|
||||
(time(NULL) - lastHeartbeatReceived) > HEARTBEAT_REPEAT_TIME * 5) {
|
||||
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::tick() No heartbeat from the peer, assume connection is dead.");
|
||||
this->reset();
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ static const int CONNECT_UNREACHABLE = 3;
|
|||
static const int CONNECT_FIREWALLED = 4;
|
||||
static const int CONNECT_FAILED = 5;
|
||||
|
||||
static const int HEARTBEAT_REPEAT_TIME = 10;
|
||||
static const int HEARTBEAT_REPEAT_TIME = 5;
|
||||
|
||||
#include "pqi/pqistreamer.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue