mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-15 12:13:24 +00:00
logging and add DST awareness to timestamps
This commit is contained in:
parent
f3d446dafb
commit
77b2903bda
@ -1012,6 +1012,7 @@ namespace llarp
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// no path?
|
// no path?
|
||||||
|
llarp::LogError("no path");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1030,6 +1031,7 @@ namespace llarp
|
|||||||
}
|
}
|
||||||
++itr;
|
++itr;
|
||||||
}
|
}
|
||||||
|
llarp::LogWarn("No path ready to send yet");
|
||||||
// all paths are not ready?
|
// all paths are not ready?
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,11 @@ llarp_time_t
|
|||||||
llarp_time_now_ms()
|
llarp_time_now_ms()
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
gettimeofday(&tv, nullptr);
|
struct timezone z;
|
||||||
|
z.tz_minuteswest = 0;
|
||||||
|
time_t t = time(nullptr);
|
||||||
|
z.tz_dsttime = gmtime(&t)->tm_isdst;
|
||||||
|
gettimeofday(&tv, &z);
|
||||||
llarp_time_t timeNow =
|
llarp_time_t timeNow =
|
||||||
(llarp_time_t)(tv.tv_sec) * 1000 + (llarp_time_t)(tv.tv_usec) / 1000;
|
(llarp_time_t)(tv.tv_sec) * 1000 + (llarp_time_t)(tv.tv_usec) / 1000;
|
||||||
return timeNow;
|
return timeNow;
|
||||||
@ -16,7 +20,11 @@ llarp_seconds_t
|
|||||||
llarp_time_now_sec()
|
llarp_time_now_sec()
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
gettimeofday(&tv, nullptr);
|
struct timezone z;
|
||||||
|
z.tz_minuteswest = 0;
|
||||||
|
time_t t = time(nullptr);
|
||||||
|
z.tz_dsttime = gmtime(&t)->tm_isdst;
|
||||||
|
gettimeofday(&tv, &z);
|
||||||
llarp_time_t timeNow = tv.tv_sec;
|
llarp_time_t timeNow = tv.tv_sec;
|
||||||
return timeNow;
|
return timeNow;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user