summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a1c2ed9)
raw | patch | inline | side by side (parent: a1c2ed9)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 7 May 2009 15:17:13 +0000 (15:17 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 7 May 2009 15:17:13 +0000 (15:17 +0000) |
* set daemon_log lines in the correct order
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13634 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13634 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-client | patch | blob | history | |
gosa-si/gosa-si-server | patch | blob | history |
diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client
index d2084e2abf6e93b3999bae4c04c267a55255315d..ee8be12b035ac6f5bea37720192f71ce4317607c 100755 (executable)
--- a/gosa-si/gosa-si-client
+++ b/gosa-si/gosa-si-client
my $error = 0;
my $answer;
-
daemon_log("INFO: Incoming msg from '$remote_ip'", 5);
daemon_log("DEBUG: Incoming msg:\n$input\n", 9);
- my ($msg, $msg_hash) = &check_key_and_xml_validity($input, $server_key);
+ # Cut of ip and port from msgs tail
+ my ($encrypted_msg, $msg_source) = split(/;/, $input);
+
+ my ($msg, $msg_hash) = &check_key_and_xml_validity($encrypted_msg, $server_key);
if( (!$msg) || (!$msg_hash) ) {
daemon_log("WARNING: Deciphering of incoming msg failed", 3);
if($server_address =~ /$remote_ip/) {
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index e652480a30134415faf11d197e3224c6d36d4aac..079e867615b5748b0af58371bc30a67e1b6b9160 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
$msg =~ s/<source>(0\.0\.0\.0):(\d*?)<\/source>/<source>$remote_ip:$2<\/source>/s;
}
+ # Memorize own source address
+ $msg =~ /<source>(\S+)<\/source>/;
+ my $own_source_address = $1;
+
# encrypt xml msg
my $crypted_msg = &encrypt_msg($msg, $encrypt_key);
# opensocket
my $socket = &open_socket($address);
if( !$socket ) {
- daemon_log("$session_id WARNING: cannot send ".$header."msg to '$address' , host not reachable", 3);
+ daemon_log("$session_id WARNING: cannot send ".$header."msg to '$address' , host not reachable! Message: '$msg'", 3);
$error++;
}
if( $error == 0 ) {
# send xml msg
- print $socket $crypted_msg."\n";
+ print $socket $crypted_msg.";$own_source_address\n";
daemon_log("$session_id INFO: send ".$header."msg to $address", 5);
daemon_log("$session_id DEBUG: message:\n$msg", 9);
if(( !$msg ) || ( !$msg_hash ) || ( !$module )){
# if an incoming msg could not be decrypted (maybe a wrong key), send client a ping. If the client
# could not understand a msg from its server the client cause a re-registering process
- my $remote_ip = $heap->{'remote_ip'};
+ daemon_log("$session_id WARNING cannot understand incoming msg, send 'ping'-msg to all host with ip '".$heap->{remote_ip}.
+ "' 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 = "<xml> <header>gosa_ping</header> <source>$server_address</source><target>$msg_source</target></xml>";
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 cannot understand incoming msg, send 'ping'-msg to all host with ip '".$heap->{remote_ip}.
- "' to cause a re-registering of the client if necessary", 3);
$error++;
}