aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-01 21:13:32 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-01 21:13:32 +0400
commitdc42a41c5e1d738373305468d61f70e0f2ee6d1a (patch)
tree773aaf3e0d54e81417f8ed7e31124a23f640a016 /utils
parentdcdcecb4998fd65c6248225b220637df6694dbad (diff)
downloadrspamd-dc42a41c5e1d738373305468d61f70e0f2ee6d1a.tar.gz
rspamd-dc42a41c5e1d738373305468d61f70e0f2ee6d1a.zip
* Improve definitions of redirector domains
* Add support of regexp to check only specific urls for each domains * Check redirector in trie and not extract specific domains parts * Add POE errors handling for redirector
Diffstat (limited to 'utils')
-rwxr-xr-xutils/redirector.pl.in15
1 files changed, 14 insertions, 1 deletions
diff --git a/utils/redirector.pl.in b/utils/redirector.pl.in
index 3ed8838e2..ab68e2151 100755
--- a/utils/redirector.pl.in
+++ b/utils/redirector.pl.in
@@ -421,6 +421,18 @@ sub process_input {
$kernel->post( "cl", "request", "got_response", $new_request, [0, ""]);
}
+sub sig_DIE {
+ my( $sig, $ex ) = @_[ ARG0, ARG1 ];
+ write_log ("", "$$: error in $ex->{event}: $ex->{error_str}");
+ $poe_kernel->sig_handled();
+
+ # Send the signal to session that sent the original event.
+ if( $ex->{source_session} ne $_[SESSION] ) {
+ $poe_kernel->signal( $ex->{source_session}, 'DIE', $sig, $ex );
+ }
+}
+
+
############################### Main code fragment ##################################
@@ -458,7 +470,8 @@ if (!$cfg{debug}) {
}
# Reopen log on SIGUSR1
-$SIG{USR1} = sub { $do_reopen_log = 1; };
+$poe_kernel->sig(DIE => 'sig_DIE');
+$SIG{USR1} = sub { $do_reopen_log = 1; $poe_kernel->sig_handled(); };
$SIG{INT} = sub { $poe_kernel->stop(); };
$SIG{QUIT} = sub { $poe_kernel->stop(); };
$SIG{PIPE} = 'IGNORE';