mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-30 16:13:51 +00:00
fixed bug in overlay_gettime_ms() (start time was 32bits not 64bits,
so strange behaviour resulted, breaking dna number lookup).
This commit is contained in:
parent
e870c35422
commit
4ddb7a5572
@ -45,15 +45,19 @@ unsigned int overlay_sequence_number=0;
|
|||||||
/* Do we need to repeat our abbreviation policy? */
|
/* Do we need to repeat our abbreviation policy? */
|
||||||
int overlay_interface_repeat_abbreviation_policy[OVERLAY_MAX_INTERFACES]={1};
|
int overlay_interface_repeat_abbreviation_policy[OVERLAY_MAX_INTERFACES]={1};
|
||||||
|
|
||||||
/* Return milliseconds since server started. First call will always return zero. */
|
/* Return milliseconds since server started. First call will always return zero.
|
||||||
|
Must use long long, not time_t, as time_t can be 32bits, which is too small for
|
||||||
|
milli-seconds since 1970. */
|
||||||
|
long long overlay_sequence_start_time = 0;
|
||||||
long long overlay_gettime_ms()
|
long long overlay_gettime_ms()
|
||||||
{
|
{
|
||||||
static time_t overlay_sequence_start_time = 0;
|
long long now;
|
||||||
long long now = gettime_ms();
|
|
||||||
if (!overlay_sequence_start_time) {
|
if (!overlay_sequence_start_time) {
|
||||||
overlay_sequence_start_time = now;
|
overlay_sequence_start_time = gettime_ms();
|
||||||
now = 0;
|
now = 0;
|
||||||
}
|
} else
|
||||||
|
now= gettime_ms()-overlay_sequence_start_time;
|
||||||
|
|
||||||
return now;
|
return now;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user