diff --git a/Timestamp.cpp b/Timestamp.cpp new file mode 100644 index 00000000..f935df62 --- /dev/null +++ b/Timestamp.cpp @@ -0,0 +1,10 @@ +#include "Timestamp.h" + +namespace i2p +{ +namespace util +{ + std::chrono::system_clock::duration g_TimeOffset = std::chrono::system_clock::duration::zero (); +} +} + diff --git a/Timestamp.h b/Timestamp.h index d48cb164..2e61d856 100644 --- a/Timestamp.h +++ b/Timestamp.h @@ -8,6 +8,8 @@ namespace i2p { namespace util { + extern std::chrono::system_clock::duration g_TimeOffset; + inline uint64_t GetMillisecondsSinceEpoch () { return std::chrono::duration_cast( diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 90a679b2..a31fcfb2 100755 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -57,6 +57,7 @@ LOCAL_SRC_FILES := DaemonAndroid.cpp i2pd_android.cpp \ ../../TunnelEndpoint.cpp \ ../../TunnelGateway.cpp \ ../../TunnelPool.cpp \ + ../../Timestamp.cpp \ ../../util.cpp \ ../../i2pd.cpp ../../UPnP.cpp diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 61b8fdf9..95f223ef 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -55,6 +55,7 @@ set (LIBI2PD_SRC "${CMAKE_SOURCE_DIR}/Datagram.cpp" "${CMAKE_SOURCE_DIR}/Family.cpp" "${CMAKE_SOURCE_DIR}/Signature.cpp" + "${CMAKE_SOURCE_DIR}/Timestamp.cpp" "${CMAKE_SOURCE_DIR}/api.cpp" ) diff --git a/filelist.mk b/filelist.mk index db243866..cb1263e3 100644 --- a/filelist.mk +++ b/filelist.mk @@ -5,7 +5,7 @@ LIB_SRC = \ SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp TransitTunnel.cpp \ Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp TunnelGateway.cpp \ Destination.cpp Base.cpp I2PEndian.cpp FS.cpp Config.cpp Family.cpp \ - Config.cpp HTTP.cpp util.cpp api.cpp + Config.cpp HTTP.cpp Timestamp.cpp util.cpp api.cpp LIB_CLIENT_SRC = \ AddressBook.cpp BOB.cpp ClientContext.cpp I2PTunnel.cpp I2PService.cpp \ diff --git a/qt/i2pd_qt/i2pd_qt.pro b/qt/i2pd_qt/i2pd_qt.pro index 90ab6c10..0972f65c 100644 --- a/qt/i2pd_qt/i2pd_qt.pro +++ b/qt/i2pd_qt/i2pd_qt.pro @@ -35,7 +35,8 @@ SOURCES += DaemonQT.cpp mainwindow.cpp \ ../../RouterInfo.cpp ../../SAM.cpp ../../Signature.cpp ../../SOCKS.cpp ../../SSU.cpp \ ../../SSUData.cpp ../../SSUSession.cpp ../../Streaming.cpp ../../TransitTunnel.cpp \ ../../Transports.cpp ../../Tunnel.cpp ../../TunnelEndpoint.cpp ../../TunnelGateway.cpp \ - ../../TunnelPool.cpp ../../UPnP.cpp ../../util.cpp ../../Gzip.cpp ../../i2pd.cpp + ../../TunnelPool.cpp ../../UPnP.cpp ../../Gzip.cpp ../../Timestamp.cpp ../../util.cpp \ + ../../i2pd.cpp HEADERS += DaemonQT.h mainwindow.h \ ../../HTTPServer.h ../../I2PControl.h ../../UPnP.h ../../Daemon.h ../../Config.h \