From acda78d54811477a4fe1b2510a0572414619ae05 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Tue, 27 May 2008 06:55:32 +0000 Subject: [PATCH] * gosa-si-server-nobus * under construction git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11011 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-server-nobus | 5 +++-- gosa-si/modules/DBsqlite.pm | 2 +- gosa-si/server/events/server_server_com.pm | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gosa-si/gosa-si-server-nobus b/gosa-si/gosa-si-server-nobus index ffae53c60..84097f391 100755 --- a/gosa-si/gosa-si-server-nobus +++ b/gosa-si/gosa-si-server-nobus @@ -891,6 +891,7 @@ sub send_msg_to_target { my ($msg, $address, $encrypt_key, $msg_header, $session_id) = @_ ; my $error = 0; my $header; + my $timestamp = &get_time(); my $new_status; my $act_status; my ($sql_statement, $res); @@ -945,7 +946,7 @@ sub send_msg_to_target { $res = $known_clients_db->del_dbentry($sql_statement); daemon_log("$session_id WARNING: failed 2x to send msg to host '$address', delete host from known_clients", 3); } else { - $sql_statement = "UPDATE known_clients SET status='$new_status' WHERE hostname='$address'"; + $sql_statement = "UPDATE known_clients SET status='$new_status', timestamp='$timestamp' WHERE hostname='$address'"; $res = $known_clients_db->update_dbentry($sql_statement); if($new_status eq "down"){ daemon_log("$session_id WARNING: set '$address' from status '$act_status' to '$new_status'", 3); @@ -966,7 +967,7 @@ sub send_msg_to_target { daemon_log("$session_id WARNING: failed 2x to send a message to host '$address', delete host from known_server", 3); } else { - $sql_statement = "UPDATE known_server SET status='$new_status' WHERE hostname='$address'"; + $sql_statement = "UPDATE known_server SET status='$new_status', timestamp='$timestamp' WHERE hostname='$address'"; $res = $known_server_db->update_dbentry($sql_statement); if($new_status eq "down"){ daemon_log("$session_id WARNING: set '$address' from status '$act_status' to '$new_status'", 3); diff --git a/gosa-si/modules/DBsqlite.pm b/gosa-si/modules/DBsqlite.pm index d1bd03d23..cd11a4535 100644 --- a/gosa-si/modules/DBsqlite.pm +++ b/gosa-si/modules/DBsqlite.pm @@ -117,7 +117,7 @@ sub add_dbentry { my $create_id=0; foreach my $col_name (@{$col_names}) { if($col_name eq "id" && (! exists $arg->{$col_name})) { - &main::daemon_log("0 DEBUG: id field found without value! Creating autoincrement statement!", 7); + #&main::daemon_log("0 DEBUG: id field found without value! Creating autoincrement statement!", 7); $create_id=1; } } diff --git a/gosa-si/server/events/server_server_com.pm b/gosa-si/server/events/server_server_com.pm index b2dc84776..c2f8e7708 100644 --- a/gosa-si/server/events/server_server_com.pm +++ b/gosa-si/server/events/server_server_com.pm @@ -54,8 +54,8 @@ sub new_server { } # delete all entries at foreign_clients_db coresponding to this server - my $sql = "DELETE FROM $main::foreign_clients_tn WHERE regserver='$source' "; - my $res = $main::foreign_clients_db->exec_statement($sql); + my $del_sql = "DELETE FROM $main::foreign_clients_tn WHERE regserver='$source' "; + my $del_res = $main::foreign_clients_db->exec_statement($del_sql); # add clients of foreign server to known_foreign_clients_db my @sql_list; -- 2.30.2