From 16388c73e55011adc1ab32ca8e73f77f468faf71 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 29 Nov 2021 15:11:14 +0100 Subject: [PATCH] Added additional check for packetStream --- src/main.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.js b/src/main.js index bfd719d..2a0a0a6 100644 --- a/src/main.js +++ b/src/main.js @@ -90,9 +90,17 @@ if(errorMsg){ loggerTcpdump.error(err); }); + const loggerPacketStream = logFactory("PacketStreamFactory"); userHelper.detectStreamData(proc.stdout, 10000) // Expect tcpdump-logs to have data after max. 10s .then(() => { loggerTcpdump.debug("Got first data"); + userHelper.detectStreamData(packetStreamFactory, 10000) // Expect then to have packets after further 10s + .then(() => { + loggerPacketStream.debug("Got first packet"); + }) + .catch((err) => { + if(err == 'timeout') loggerPacketStream.warn("No packets"); + }); }) .catch((err) => { if(err == 'timeout') loggerTcpdump.warn("No data after 10s! Wrong configuration?");