From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Tue, 23 Mar 2021 12:58:08 +0000 (+0000) Subject: Reenable garbage collection and set a timeout of one second! X-Git-Tag: 1.1-dev~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01ee62df6eea8a15b8f8ae9783477336ecbb376f;p=thirdparty%2Fnqptp.git Reenable garbage collection and set a timeout of one second! --- diff --git a/nqptp.c b/nqptp.c index 4494fc0..88a36b5 100644 --- a/nqptp.c +++ b/nqptp.c @@ -236,7 +236,7 @@ void deleteObseleteClockRecords(struct ptpSource **list, uint64_t time_now) { debug(2, "checking record for Clock ID %" PRIx64 " at %s. Time difference is %" PRId64 ".", p->clock_id, p->ip, time_since_last_use); - if (time_since_last_use > 3600000000000) { // drop them if idle for an hour + if (time_since_last_use > 5000000000) { // drop them if idle debug(2, "delete record for Clock ID %" PRIx64 " at %s.", p->clock_id, p->ip); if (p->shared_clock_number != -1) { int rc = pthread_mutex_lock(&shared_memory->shm_mutex); @@ -635,7 +635,7 @@ int main(void) { FD_SET(sockets[s].number, &readSockSet); } - timeout.tv_sec = 10; + timeout.tv_sec = 1; timeout.tv_usec = 0; int retval = select(smax + 1, &readSockSet, NULL, NULL, &timeout); uint64_t reception_time = get_time_now(); // use this if other methods fail @@ -1277,7 +1277,7 @@ int main(void) { } // here, invalidate records and entries that are out of date uint64_t tn = get_time_now(); - // deleteObseleteClockRecords(&clocks, tn); + deleteObseleteClockRecords(&clocks, tn); } }