From 9a0226e432112a5d0e9e7237f80924c884066306 Mon Sep 17 00:00:00 2001 From: Jon K Hellan Date: Thu, 5 Jul 2012 10:47:45 +0000 Subject: [PATCH] Don't call display_stats when endstream flag is set. Fixes double printout problem. Debian version 0.4-6 --- qstream | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qstream b/qstream index 13a95cb..3ae1018 100755 --- a/qstream +++ b/qstream @@ -153,14 +153,14 @@ $file_flag = 1 if $opt_filename; $SIG{USR2} = sub {confess "Caught by SIGUSR2"; }; $SIG{INT} = sub { $uninterrupted=0; # return if $nint++ < 1; - &display_stats(); + &display_stats() if !$endstream; &end_xml() if $opt_xml; &handle_threads() if ($opt_tcp and $opt_rtmp); die "End after interrupt.\n";exit(0) }; $SIG{TERM} = sub { $uninterrupted=0; # return if $nkill++ < 1; - &display_stats(); + &display_stats() if !$endstream; &end_xml() if $opt_xml; &handle_threads() if ($opt_tcp and $opt_rtmp); @@ -195,7 +195,7 @@ if ($opt_pcap || ($opt_tcp && !$opt_rtmp)){ # listen in parallell $uninterrupted=1; $endstream=0; eat_pcap_streams(@streams); - &display_stats() if !$opt_xml; + &display_stats() if !$opt_xml and !$endstream; } else { # listen serially my $stream_count; #my $ln = @streams; @@ -218,7 +218,7 @@ if ($opt_pcap || ($opt_tcp && !$opt_rtmp)){ # listen in parallell } &list_flows if $opt_list; -&display_stats() if $opt_sum; +&display_stats() if $opt_sum and !$endstream; &display_bins if $opt_bins; &end_xml() if $opt_xml; @@ -1591,7 +1591,7 @@ sub pkt_stats { if ($interval > $pinterval){ &mpeg_debug() if $opt_debug; - &display_stats() if !$opt_rtmp; + &display_stats() if !$opt_rtmp and !$endstream; &init_stats($f); $pinterval=$interval; $pinterval{$f}=$interval; -- GitLab