From: German Service Network Date: Sat, 26 Apr 2025 17:39:30 +0000 (+0200) Subject: Add JSON timeout event type X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77c464fcd444bd95d71fa8f64c8c5603374c6d00;p=fping.git Add JSON timeout event type --- diff --git a/ci/test-16-json-output.pl b/ci/test-16-json-output.pl index 1622920..f1cd5ba 100644 --- a/ci/test-16-json-output.pl +++ b/ci/test-16-json-output.pl @@ -56,7 +56,7 @@ $cmd->stderr_is_eq(""); { my $cmd = Test::Command->new(cmd => "fping -J -c 1 192.0.2.47"); $cmd->exit_is_num(1); -$cmd->stdout_like(qr/^\{"resp":\s\{"host":\s"192\.0\.2\.47",\s"seq":\s\d+,\s"rttAvg":\s"NaN",\s"loss":\s\d+\}\} +$cmd->stdout_like(qr/^\{"timeout":\s\{"host":\s"192\.0\.2\.47",\s"seq":\s\d+,\s"rttAvg":\s"NaN",\s"loss":\s\d+\}\} \{"summary":\s\{"host":\s"192\.0\.2\.47",\s"xmt":\s\d+,\s"rcv":\s\d+,\s"loss":\s\d+\}\}\n?$/); $cmd->stderr_is_eq(""); } diff --git a/src/fping.c b/src/fping.c index 6f6b3f8..c632fb0 100644 --- a/src/fping.c +++ b/src/fping.c @@ -1713,7 +1713,7 @@ void main_loop() if (per_recv_flag) { if (json_flag) - printf("{\"resp\": {"); + printf("{\"timeout\": {"); if (timestamp_flag) { if (json_flag)