Commit 9a0226e4 authored by Jon Kåre Hellan's avatar Jon Kåre Hellan

Don't call display_stats when endstream flag is set. Fixes double

    printout problem. Debian version 0.4-6
parent 5be06e74
...@@ -153,14 +153,14 @@ $file_flag = 1 if $opt_filename; ...@@ -153,14 +153,14 @@ $file_flag = 1 if $opt_filename;
$SIG{USR2} = sub {confess "Caught by SIGUSR2"; }; $SIG{USR2} = sub {confess "Caught by SIGUSR2"; };
$SIG{INT} = sub { $uninterrupted=0; # return if $nint++ < 1; $SIG{INT} = sub { $uninterrupted=0; # return if $nint++ < 1;
&display_stats(); &display_stats() if !$endstream;
&end_xml() if $opt_xml; &end_xml() if $opt_xml;
&handle_threads() if ($opt_tcp and $opt_rtmp); &handle_threads() if ($opt_tcp and $opt_rtmp);
die "End after interrupt.\n";exit(0) }; die "End after interrupt.\n";exit(0) };
$SIG{TERM} = sub { $uninterrupted=0; # return if $nkill++ < 1; $SIG{TERM} = sub { $uninterrupted=0; # return if $nkill++ < 1;
&display_stats(); &display_stats() if !$endstream;
&end_xml() if $opt_xml; &end_xml() if $opt_xml;
&handle_threads() if ($opt_tcp and $opt_rtmp); &handle_threads() if ($opt_tcp and $opt_rtmp);
...@@ -195,7 +195,7 @@ if ($opt_pcap || ($opt_tcp && !$opt_rtmp)){ # listen in parallell ...@@ -195,7 +195,7 @@ if ($opt_pcap || ($opt_tcp && !$opt_rtmp)){ # listen in parallell
$uninterrupted=1; $uninterrupted=1;
$endstream=0; $endstream=0;
eat_pcap_streams(@streams); eat_pcap_streams(@streams);
&display_stats() if !$opt_xml; &display_stats() if !$opt_xml and !$endstream;
} else { # listen serially } else { # listen serially
my $stream_count; my $stream_count;
#my $ln = @streams; #my $ln = @streams;
...@@ -218,7 +218,7 @@ if ($opt_pcap || ($opt_tcp && !$opt_rtmp)){ # listen in parallell ...@@ -218,7 +218,7 @@ if ($opt_pcap || ($opt_tcp && !$opt_rtmp)){ # listen in parallell
} }
&list_flows if $opt_list; &list_flows if $opt_list;
&display_stats() if $opt_sum; &display_stats() if $opt_sum and !$endstream;
&display_bins if $opt_bins; &display_bins if $opt_bins;
&end_xml() if $opt_xml; &end_xml() if $opt_xml;
...@@ -1591,7 +1591,7 @@ sub pkt_stats { ...@@ -1591,7 +1591,7 @@ sub pkt_stats {
if ($interval > $pinterval){ if ($interval > $pinterval){
&mpeg_debug() if $opt_debug; &mpeg_debug() if $opt_debug;
&display_stats() if !$opt_rtmp; &display_stats() if !$opt_rtmp and !$endstream;
&init_stats($f); &init_stats($f);
$pinterval=$interval; $pinterval=$interval;
$pinterval{$f}=$interval; $pinterval{$f}=$interval;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment