From e9d1efc1ae29ee86b3c2a42bf56531afac7add6d Mon Sep 17 00:00:00 2001 From: peavey Date: Mon, 13 Aug 2007 22:16:41 +0000 Subject: Fix new millisec /map to compile on windows, by ifndef gettimeofday out reverting back to seconds for latency. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7717 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/treesocket2.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/modules/m_spanningtree/treesocket2.cpp') diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 88c7666bf..527c0122b 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -365,10 +365,14 @@ bool TreeSocket::LocalPong(const std::string &prefix, std::deque &p if (ServerSource) { ServerSource->SetPingFlag(); +#ifndef WIN32 timeval t; gettimeofday(&t, NULL); long ts = (t.tv_sec * 1000) + (t.tv_usec / 1000); ServerSource->rtt = ts - ServerSource->LastPingMsec; +#else + ServerSource->rtt = Instance->Time() - ServerSource->LastPing; +#endif } } else -- cgit v1.2.3