From: rettenbe Date: Fri, 8 May 2009 14:00:45 +0000 (+0000) Subject: change handling of undecipherable messages X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8746b6dd830cbb87e4caf0e38200521794b5d752;p=gosa.git change handling of undecipherable messages git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13637 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index ffa57e14c..192e8d65f 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -1072,11 +1072,12 @@ sub msg_to_decrypt { # msg is from a gosa-si-server if(( !$msg ) || ( !$msg_hash ) || ( !$module )){ - ($msg, $msg_hash, $module) = &input_from_known_server($next_msg, $heap->{'remote_ip'}, $session_id); + #($msg, $msg_hash, $module) = &input_from_known_server($next_msg, $heap->{'remote_ip'}, $session_id); + ($msg, $msg_hash, $module) = &input_from_known_server($next_msg, $msg_source, $session_id); } # msg is from a gosa-si-client if(( !$msg ) || ( !$msg_hash ) || ( !$module )){ - ($msg, $msg_hash, $module) = &input_from_known_client($next_msg, $heap->{'remote_ip'}, $session_id); + ($msg, $msg_hash, $module) = &input_from_known_client($next_msg, $msg_source, $session_id); } # an error occurred if(( !$msg ) || ( !$msg_hash ) || ( !$module )){ @@ -1084,7 +1085,7 @@ sub msg_to_decrypt { # or a server. In case of a client, send a ping. If the client could not understand a msg from its # server the client cause a re-registering process. In case of a server, decrease update_time in kown_server_db # and trigger a re-registering process for servers - if (defined $msg_source && $msg_source =~ /^\d+:$server_port$/) + if (defined $msg_source && $msg_source =~ /:$server_port$/) { daemon_log("$session_id WARNING: Cannot understand incoming msg from server '$msg_source'. Cause re-registration process for servers.", 3); my $update_statement = "UPDATE $known_server_tn SET update_time='19700101000000' WHERE hostname='$msg_source'"; @@ -1092,14 +1093,20 @@ sub msg_to_decrypt { my $upadte_res = $known_server_db->exec_statement($update_statement); $kernel->yield("register_at_foreign_servers"); } - else + elsif (defined $msg_source) { - daemon_log("$session_id WARNING: Cannot understand incoming msg from client '".$heap->{remote_ip}."'. Send ping-msg to cause a re-registering of the client if necessary", 3); - my $remote_ip = $heap->{'remote_ip'}; - my $remote_port = $heap->{'remote_port'}; + daemon_log("$session_id WARNING: Cannot understand incoming msg from client '$msg_source'. Send ping-msg to cause a re-registering of the client if necessary", 3); + #my $remote_ip = $heap->{'remote_ip'}; + #my $remote_port = $heap->{'remote_port'}; my $ping_msg = "
gosa_ping
$server_address$msg_source
"; my ($test_error, $test_error_string) = &send_msg_to_target($ping_msg, "$msg_source", "dummy-key", "gosa_ping", $session_id); + daemon_log("$session_id WARNING: sending msg to cause re-registering: $ping_msg", 3); } + else + { + daemon_log("$session_id ERROR: incoming message contains no msg source. Processing aborted: $tmp_next_msg", 1); + } + $error++; }