mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-10 01:55:19 -04:00
* Memory Leak fixed in BinaryData.
* Fixed up Variable Ticking -> max = 1.0 sec now. * Removed debug output which was massively increasing CPU load. * Removed some old code from p3face-server.cc git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@461 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d69c2f72f1
commit
99aab9cea4
7 changed files with 81 additions and 36 deletions
|
@ -32,6 +32,10 @@
|
|||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
/****
|
||||
#define DEBUG_TICK 1
|
||||
****/
|
||||
|
||||
RsServer::RsServer(RsIface &i, NotifyBase &callback)
|
||||
:RsControl(i, callback)
|
||||
{
|
||||
|
@ -47,23 +51,6 @@ RsServer::~RsServer()
|
|||
----> MUST BE LOCKED!
|
||||
*/
|
||||
|
||||
#if 0
|
||||
cert *RsServer::intFindCert(RsCertId id)
|
||||
{
|
||||
certsign cs;
|
||||
convert_to_certsign(id, cs);
|
||||
return sslr -> findcertsign(cs);
|
||||
}
|
||||
|
||||
RsCertId RsServer::intGetCertId(cert *c)
|
||||
{
|
||||
certsign cs;
|
||||
sslr -> getcertsign(c, cs);
|
||||
RsCertId id = convert_to_str(cs);
|
||||
return id;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS_SYS
|
||||
#include <time.h>
|
||||
#include <sys/timeb.h>
|
||||
|
@ -91,7 +78,7 @@ void RsServer::run()
|
|||
|
||||
double timeDelta = 0.25;
|
||||
double minTimeDelta = 0.1; // 25;
|
||||
double maxTimeDelta = 2.0;
|
||||
double maxTimeDelta = 1.0;
|
||||
double kickLimit = 0.5;
|
||||
|
||||
double avgTickRate = timeDelta;
|
||||
|
@ -118,17 +105,21 @@ void RsServer::run()
|
|||
/* for the fast ticked stuff */
|
||||
if (delta > timeDelta)
|
||||
{
|
||||
//std::cerr << "Delta: " << delta << std::endl;
|
||||
//std::cerr << "Time Delta: " << timeDelta << std::endl;
|
||||
//std::cerr << "Avg Tick Rate: " << avgTickRate << std::endl;
|
||||
#ifdef DEBUG_TICK
|
||||
std::cerr << "Delta: " << delta << std::endl;
|
||||
std::cerr << "Time Delta: " << timeDelta << std::endl;
|
||||
std::cerr << "Avg Tick Rate: " << avgTickRate << std::endl;
|
||||
#endif
|
||||
|
||||
lastts = ts;
|
||||
|
||||
/******************************** RUN SERVER *****************/
|
||||
lockRsCore();
|
||||
|
||||
// std::cerr << "RsServer::run() Lock() -> Run()" << std::endl;
|
||||
int moreToTick = server -> tick();
|
||||
#ifdef DEBUG_TICK
|
||||
std::cerr << "RsServer::run() server->tick(): moreToTick: " << moreToTick << std::endl;
|
||||
#endif
|
||||
|
||||
unlockRsCore();
|
||||
|
||||
|
@ -187,7 +178,9 @@ void RsServer::run()
|
|||
|
||||
// Update All Every 5 Seconds.
|
||||
// These Update Functions do the locking themselves.
|
||||
//std::cerr << "RsServer::run() Updates()" << std::endl;
|
||||
#ifdef DEBUG_TICK
|
||||
std::cerr << "RsServer::run() Updates()" << std::endl;
|
||||
#endif
|
||||
|
||||
// These two have been completed!
|
||||
//std::cerr << "RsServer::run() UpdateAllCerts()" << std::endl;
|
||||
|
@ -222,7 +215,6 @@ void RsServer::run()
|
|||
mRanking->tick();
|
||||
|
||||
|
||||
/* force saving test */
|
||||
#if 0
|
||||
std::string opt;
|
||||
std::string val = "VALUE";
|
||||
|
@ -262,13 +254,6 @@ void RsServer::run()
|
|||
} // end of slow tick.
|
||||
|
||||
} // end of only once a second.
|
||||
|
||||
// update graphics.. ( but only if gui is visible )
|
||||
// This is also triggered in slow tick...
|
||||
//if ((ui->main_win->shown()) || (ui->chatter_window->shown()))
|
||||
{
|
||||
// update();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue