mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
fix timestamp math that had newer sometimes less than older
This commit is contained in:
parent
7967966982
commit
27e9b48b78
1 changed files with 8 additions and 2 deletions
|
@ -27,6 +27,8 @@
|
||||||
#include "xwrelay_priv.h"
|
#include "xwrelay_priv.h"
|
||||||
#include "tpool.h"
|
#include "tpool.h"
|
||||||
|
|
||||||
|
// static uint32_t s_prevCreated = 0L;
|
||||||
|
|
||||||
void
|
void
|
||||||
AddrInfo::construct( int socket, const AddrUnion* saddr, bool isTCP )
|
AddrInfo::construct( int socket, const AddrUnion* saddr, bool isTCP )
|
||||||
{
|
{
|
||||||
|
@ -34,8 +36,12 @@ AddrInfo::construct( int socket, const AddrUnion* saddr, bool isTCP )
|
||||||
|
|
||||||
struct timespec tp;
|
struct timespec tp;
|
||||||
clock_gettime( CLOCK_MONOTONIC, &tp );
|
clock_gettime( CLOCK_MONOTONIC, &tp );
|
||||||
m_created = (tp.tv_sec * 1000) + (tp.tv_nsec / 1000);
|
/* convert to milliseconds */
|
||||||
logf( XW_LOGINFO, "%s: m_created for socket %d: 0x%lx", __func__, socket, m_created );
|
m_created = (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000);
|
||||||
|
logf( XW_LOGINFO, "%s: m_created for socket %d: %lx",
|
||||||
|
__func__, socket, m_created );
|
||||||
|
/* assert( m_created >= s_prevCreated ); */
|
||||||
|
/* s_prevCreated = m_created; */
|
||||||
|
|
||||||
m_socket = socket;
|
m_socket = socket;
|
||||||
m_isTCP = isTCP;
|
m_isTCP = isTCP;
|
||||||
|
|
Loading…
Add table
Reference in a new issue