From d7bf70c610425b2211d7b58d1998f052ca65a6cb Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 12 Oct 2016 19:37:59 +0100 Subject: [Fix] Fix issues with CGP helper --- utils/cgp_rspamd.pl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/cgp_rspamd.pl b/utils/cgp_rspamd.pl index 03ecd7a94..6417646bf 100644 --- a/utils/cgp_rspamd.pl +++ b/utils/cgp_rspamd.pl @@ -123,10 +123,16 @@ sub rspamd_scan { ); } else { - $sb = stat($file); + my $sb = stat($file); if ( !$sb || $sb->size > $max_size ) { - print "* File $file is too large: " . $sb->size . "\n$tag FAILURE\n"; + if ($sb) { + print "* File $file is too large: " . $sb->size . "\n$tag FAILURE\n"; + + } + else { + print "* Cannot stat $file: $!\n$tag FAILURE\n"; + } return; } aio_load( @@ -214,6 +220,10 @@ my $w = AnyEvent->io( print "$tag OK\n"; exit 0; } + else { + print "* Unknown command $cmd\n"; + print "$tag FAILURE\n"; + } } } ); -- cgit v1.2.3