richard: server/perl-kolab/lib/Kolab/LDAP/Backend syncrepl.pm, 1.1, 1.2

cvs at kolab.org cvs at kolab.org
Thu Jul 17 11:55:48 CEST 2008


Author: richard

Update of /kolabrepository/server/perl-kolab/lib/Kolab/LDAP/Backend
In directory doto:/tmp/cvs-serv21993

Modified Files:
	syncrepl.pm 
Log Message:
Change the log marker 'SYNC' to 'SYNCREPL' to better reflect the
actual module name.



Index: syncrepl.pm
===================================================================
RCS file: /kolabrepository/server/perl-kolab/lib/Kolab/LDAP/Backend/syncrepl.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- syncrepl.pm	17 Jul 2008 08:59:08 -0000	1.1
+++ syncrepl.pm	17 Jul 2008 09:55:46 -0000	1.2
@@ -140,13 +140,13 @@
 
 sub shutdown
 {
-  Kolab::log('SYNC', 'Shutting down');
+  Kolab::log('SYNCREPL', 'Shutting down');
   exit(0);
 }
 
 sub abort
 {
-    Kolab::log('SYNC', 'Aborting');
+    Kolab::log('SYNCREPL', 'Aborting');
     exit(1);
 }
 
@@ -164,7 +164,7 @@
   my $mesg;
 
   while (1) {
-    Kolab::log('SYNC', 'Creating LDAP connection to LDAP server', KOLAB_DEBUG);
+    Kolab::log('SYNCREPL', 'Creating LDAP connection to LDAP server', KOLAB_DEBUG);
 
     $ldap = Kolab::LDAP::create($Kolab::config{'user_ldap_ip'},
                                 $Kolab::config{'user_ldap_port'},
@@ -173,18 +173,18 @@
                                 1
                                );
     if (!$ldap) {
-        Kolab::log('SYNC', 'Sleeping 5 seconds...');
+        Kolab::log('SYNCREPL', 'Sleeping 5 seconds...');
         sleep 5;
         next;
     }
     $disconnected = 0;  
 
-    Kolab::log('SYNC', 'LDAP connection established', KOLAB_DEBUG);
+    Kolab::log('SYNCREPL', 'LDAP connection established', KOLAB_DEBUG);
 
     Kolab::LDAP::ensureAsync($ldap);
-    Kolab::log('SYNC', 'Async checked', KOLAB_DEBUG);
+    Kolab::log('SYNCREPL', 'Async checked', KOLAB_DEBUG);
 
-    Kolab::log('SYNC', "Cookie: $cookie", KOLAB_DEBUG);
+    Kolab::log('SYNCREPL', "Cookie: $cookie", KOLAB_DEBUG);
 
     while($ldap and not $disconnected) {
 	    #sync control
@@ -196,7 +196,7 @@
                                                                                ),
                                          critical   => 0
 	                                      );
-      Kolab::log('SYNC', 'Control created', KOLAB_DEBUG);
+      Kolab::log('SYNCREPL', 'Control created', KOLAB_DEBUG);
     
 	    #search
 	    my $mesg = $ldap->search(base     => $Kolab::config{'base_dn'},
@@ -211,9 +211,9 @@
                                              $Kolab::config{'user_field_deleted'},
                                            ],
 				                      );
-      Kolab::log('SYNC', 'Search created', KOLAB_DEBUG);
+      Kolab::log('SYNCREPL', 'Search created', KOLAB_DEBUG);
       $mesg->sync;
-      Kolab::log('SYNC', "Finished Net::LDAP::Search::sync sleeping 10s", KOLAB_DEBUG);
+      Kolab::log('SYNCREPL', "Finished Net::LDAP::Search::sync sleeping 10s", KOLAB_DEBUG);
       sleep 10;
     }
   }
@@ -227,42 +227,42 @@
   my $issearch = $mesg->isa("Net::LDAP::Search");
   my @controls = $mesg->control;
   if(not $issearch) {
-    Kolab::log('SYNC', 'mesg is not a search object, testing code...', KOLAB_DEBUG);
+    Kolab::log('SYNCREPL', 'mesg is not a search object, testing code...', KOLAB_DEBUG);
     if ($mesg->code == 88) {
-        Kolab::log('SYNC', 'searchCallback() -> Exit code received, returning', KOLAB_DEBUG);
+        Kolab::log('SYNCREPL', 'searchCallback() -> Exit code received, returning', KOLAB_DEBUG);
         return;
     } elsif ($mesg->code) {
-        Kolab::log('SYNC', "Not a search: mesg->code = `" . $mesg->code . "', mesg->msg = `" . $mesg->error . "'", KOLAB_DEBUG);
+        Kolab::log('SYNCREPL', "Not a search: mesg->code = `" . $mesg->code . "', mesg->msg = `" . $mesg->error . "'", KOLAB_DEBUG);
         &abort;
     }   
   } elsif(@controls == 0) {
     if ($mesg->code == 1) {
-        Kolab::log('SYNC', 'No control: Communications Error: disconnecting', KOLAB_DEBUG);
+        Kolab::log('SYNCREPL', 'No control: Communications Error: disconnecting', KOLAB_DEBUG);
         $disconnected = 1;
         return;
     } elsif ($mesg->code) {
-      Kolab::log('SYNC', "No control: mesg->code = `" . $mesg->code . "', mesg->msg = `" . $mesg->error . "'", KOLAB_DEBUG);
+      Kolab::log('SYNCREPL', "No control: mesg->code = `" . $mesg->code . "', mesg->msg = `" . $mesg->error . "'", KOLAB_DEBUG);
         &abort;
     }   
   } elsif($controls[0]->type eq LDAP_CONTROL_SYNC_STATE) {
-    Kolab::log('SYNC', 'Received Sync State Control', KOLAB_DEBUG);
-    Kolab::log('SYNC', "Entry (".$entry->changetype."): ".$entry->dn(), KOLAB_DEBUG);
+    Kolab::log('SYNCREPL', 'Received Sync State Control', KOLAB_DEBUG);
+    Kolab::log('SYNCREPL', "Entry (".$entry->changetype."): ".$entry->dn(), KOLAB_DEBUG);
   } elsif($controls[0]->type eq LDAP_CONTROL_SYNC_DONE) {
-    Kolab::log('SYNC', 'Received Sync Done Control', KOLAB_DEBUG);
+    Kolab::log('SYNCREPL', 'Received Sync Done Control', KOLAB_DEBUG);
     my $asn_syncDoneValue = $asn->find('syncDoneValue');
     my $out = $asn_syncDoneValue->decode($controls[0]->value);
 	  #we have a new cookie
 	  if(defined($out->{cookie}) and not $out->{cookie} eq '' and not $out->{cookie} eq $cookie) {
 		  $cookie = $out->{cookie};
-		  Kolab::log('SYNC', "New cookie: $cookie", KOLAB_DEBUG);
-      Kolab::log('SYNC', "Calling Kolab::LDAP::sync", KOLAB_DEBUG);
+		  Kolab::log('SYNCREPL', "New cookie: $cookie", KOLAB_DEBUG);
+      Kolab::log('SYNCREPL', "Calling Kolab::LDAP::sync", KOLAB_DEBUG);
       Kolab::LDAP::sync;
       system($Kolab::config{'kolabconf_script'}) == 0 || Kolab::log('SD', "Failed to run kolabconf: $?", KOLAB_ERROR);
-      Kolab::log('SYNC', "Finished Kolab::LDAP::sync sleeping 1s", KOLAB_DEBUG);
+      Kolab::log('SYNCREPL', "Finished Kolab::LDAP::sync sleeping 1s", KOLAB_DEBUG);
       sleep 1; # we get too many bogus change notifications!
 	  } 
   } else {
-    Kolab::log('SYNC', 'Received unknown control: '.$controls[0]->type, KOLAB_DEBUG);
+    Kolab::log('SYNCREPL', 'Received unknown control: '.$controls[0]->type, KOLAB_DEBUG);
   }
   return 0;
 }





More information about the commits mailing list