From f8692c6be11c664e4345ceaaec5c6b35ba9b3feb Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Thu, 19 Nov 2020 19:34:11 +0100 Subject: Let travis use pcap files from nDPI to produce some JSON output. (disabled, needs further testing..) * Added pcap diff script * Added \n to JSON string end (useful for debugging and readability) * Use first host/server name character for hash calculation as well * Removed error'ing EPOLLHUP handling in nDPIsrvd (connection closing will be detected via read()) Signed-off-by: Toni Uhlig --- examples/c-json-stdout/c-json-stdout.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/c-json-stdout/c-json-stdout.c') diff --git a/examples/c-json-stdout/c-json-stdout.c b/examples/c-json-stdout/c-json-stdout.c index b70d7bac5..015bc99fe 100644 --- a/examples/c-json-stdout/c-json-stdout.c +++ b/examples/c-json-stdout/c-json-stdout.c @@ -90,7 +90,8 @@ int main(void) break; } - if (buf[json_bytes - 1] != '}') + if (buf[json_bytes - 2] != '}' || + buf[json_bytes - 1] != '\n') { fprintf(stderr, "BUG: Invalid JSON string: %.*s\n", (int)json_bytes, buf); exit(1); -- cgit v1.2.3