From 3ae112095dea1ce1158025f0adbf0c41058ce991 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 24 May 2019 10:51:10 +0200 Subject: [PATCH] fix changes to villas-hook --- src/villas-hook.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/villas-hook.cpp b/src/villas-hook.cpp index 2408491ac..4ac3455b9 100644 --- a/src/villas-hook.cpp +++ b/src/villas-hook.cpp @@ -222,12 +222,8 @@ check: if (optarg == endptr) throw RuntimeError("Failed to read from stdin"); } - - if (!(smp->flags & SAMPLE_HAS_TS_RECEIVED)){ - timespec now = time_now(); - smp->ts.received = now; - smp->flags |= SAMPLE_HAS_TS_RECEIVED; - } + + timespec now = time_now(); logger->debug("Read {} smps from stdin", recv); @@ -235,6 +231,11 @@ check: if (optarg == endptr) for (int processed = 0; processed < recv; processed++) { struct sample *smp = smps[processed]; + if (!(smp->flags & SAMPLE_HAS_TS_RECEIVED)){ + smp->ts.received = now; + smp->flags |= SAMPLE_HAS_TS_RECEIVED; + } + ret = h->process(smp); switch (ret) { case HOOK_ERROR: