mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 05:38:51 -04:00
Use safer rstime_t instead of time_t
Avoid problems to serialization on different platforms, without breaking nested STL containers serialization. The conversion have been made with sed, and checked with grep, plus kdiff3 visual ispection, plus rutime tests, so it should be fine.
This commit is contained in:
parent
41aa675a9b
commit
329050a9c2
223 changed files with 930 additions and 911 deletions
|
@ -23,7 +23,7 @@
|
|||
#include "retroshare/rsconfig.h"
|
||||
#include "util/rsnet.h"
|
||||
#include "pqi/pqinetstatebox.h"
|
||||
#include "time.h"
|
||||
#include "util/rstime.h"
|
||||
|
||||
#ifdef RS_USE_BITDHT
|
||||
#include "bitdht/bdiface.h"
|
||||
|
@ -191,7 +191,7 @@ void pqiNetStateBox::reset()
|
|||
{
|
||||
|
||||
mStatusOkay = false;
|
||||
//time_t mStatusTS;
|
||||
//rstime_t mStatusTS;
|
||||
|
||||
mNetworkMode = RSNET_NETWORK_UNKNOWN;
|
||||
mNatTypeMode = RSNET_NATTYPE_UNKNOWN;
|
||||
|
@ -244,7 +244,7 @@ int pqiNetStateBox::statusOkay()
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
time_t now = time(NULL);
|
||||
rstime_t now = time(NULL);
|
||||
if (now - mStatusTS > NETSTATE_TIMEOUT)
|
||||
{
|
||||
return 0;
|
||||
|
@ -268,7 +268,7 @@ void pqiNetStateBox::clearOldNetworkData()
|
|||
{
|
||||
#ifdef RS_USE_DHT_STUNNER
|
||||
/* check if any measurements are too old to consider */
|
||||
time_t now = time(NULL);
|
||||
rstime_t now = time(NULL);
|
||||
if (now - mStunProxyTS > NETSTATE_PARAM_TIMEOUT)
|
||||
{
|
||||
mStunProxySet = false;
|
||||
|
@ -292,7 +292,7 @@ void pqiNetStateBox::clearOldNetworkData()
|
|||
void pqiNetStateBox::determineNetworkState()
|
||||
{
|
||||
clearOldNetworkData();
|
||||
time_t now = time(NULL);
|
||||
rstime_t now = time(NULL);
|
||||
|
||||
/* now we use the remaining valid input to determine network state */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue