From 97b21ad00481c2659d3c7a8fdbff0ee2ec0a4986 Mon Sep 17 00:00:00 2001 From: janw Date: Thu, 11 Sep 2008 07:06:00 +0000 Subject: [PATCH] Added debug output. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12411 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-server | 63 +++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 99e02fdb4..1820ebd1f 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -696,42 +696,43 @@ sub input_from_known_client { sub input_from_unknown_host { - no strict "refs"; - my ($input, $session_id) = @_ ; - my ($msg, $msg_hash, $module); - my $error_string; - + no strict "refs"; + my ($input, $session_id) = @_ ; + my ($msg, $msg_hash, $module); + my $error_string; + my %act_modules = %$known_modules; - - while( my ($mod, $info) = each(%act_modules)) { - # check a key exists for this module - my $module_key = ${$mod."_key"}; - if( not defined $module_key ) { - if( $mod eq 'ArpHandler' ) { - next; - } - daemon_log("$session_id ERROR: no key specified in config file for $mod", 1); - next; - } - daemon_log("$session_id DEBUG: $mod: $module_key", 7); + while( my ($mod, $info) = each(%act_modules)) { - # check if module can open msg envelope with module key - ($msg, $msg_hash) = &check_key_and_xml_validity($input, $module_key, $session_id); - if( (not defined $msg) || (not defined $msg_hash) ) { - next; - } - else { - $module = $mod; - last; - } - } + # check a key exists for this module + my $module_key = ${$mod."_key"}; + if( not defined $module_key ) { + if( $mod eq 'ArpHandler' ) { + next; + } + daemon_log("$session_id ERROR: no key specified in config file for $mod", 1); + next; + } + daemon_log("$session_id DEBUG: $mod: $module_key", 7); - if( (!$msg) || (!$msg_hash) || (!$module)) { - daemon_log("$session_id DEBUG: Incoming message is not from an unknown host", 7); - } + # check if module can open msg envelope with module key + ($msg, $msg_hash) = &check_key_and_xml_validity($input, $module_key, $session_id); + if( (not defined $msg) || (not defined $msg_hash) ) { + daemon_log("$session_id ERROR: no msg returned!", 2) if (not defined $msg || "" eq $msg); + daemon_log("$session_id ERROR: no msg_hash returned!", 2) if (not defined $msg_hash || "" eq $msg_hash); + next; + } else { + $module = $mod; + last; + } + } - return ($msg, $msg_hash, $module); + if( (!$msg) || (!$msg_hash) || (!$module)) { + daemon_log("$session_id DEBUG: Incoming message is not from an unknown host", 7); + } + + return ($msg, $msg_hash, $module); } -- 2.30.2