wreplsrv: log a successful replication cycle at level 1
[kai/samba.git] / source4 / wrepl_server / wrepl_in_call.c
index dab7b52307848c00c87b813c13cf823420881dc4..a4f18ff2da44579a882031adc5b92646b69f7aab 100644 (file)
@@ -7,7 +7,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -16,8 +16,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
@@ -62,7 +61,7 @@ static NTSTATUS wreplsrv_in_start_association(struct wreplsrv_in_call *call)
        }
 #endif
 
-       call->wreplconn->assoc_ctx.stopped      = False;
+       call->wreplconn->assoc_ctx.stopped      = false;
        call->wreplconn->assoc_ctx.our_ctx      = WREPLSRV_VALID_ASSOC_CTX;
        call->wreplconn->assoc_ctx.peer_ctx     = start->assoc_ctx;
 
@@ -91,7 +90,7 @@ static NTSTATUS wreplsrv_in_stop_assoc_ctx(struct wreplsrv_in_call *call)
 {
        struct wrepl_stop *stop_out             = &call->rep_packet.message.stop;
 
-       call->wreplconn->assoc_ctx.stopped      = True;
+       call->wreplconn->assoc_ctx.stopped      = true;
 
        call->rep_packet.mess_type              = WREPL_STOP_ASSOCIATION;
        stop_out->reason                        = 4;
@@ -121,7 +120,7 @@ static NTSTATUS wreplsrv_in_stop_association(struct wreplsrv_in_call *call)
        }
 
        /* this will cause to not receive packets anymore and terminate the connection if the reply is send */
-       call->terminate_after_send = True;
+       call->terminate_after_send = true;
        return wreplsrv_in_stop_assoc_ctx(call);
 }
 
@@ -134,7 +133,7 @@ static NTSTATUS wreplsrv_in_table_query(struct wreplsrv_in_call *call)
        repl_out->command = WREPL_REPL_TABLE_REPLY;
 
        return wreplsrv_fill_wrepl_table(service, call, table_out,
-                                        service->wins_db->local_owner, True);
+                                        service->wins_db->local_owner, true);
 }
 
 static int wreplsrv_in_sort_wins_name(struct wrepl_wins_name *n1,
@@ -263,9 +262,8 @@ static NTSTATUS wreplsrv_in_send_request(struct wreplsrv_in_call *call)
                                 (long long)owner_in->min_version, 
                                 (long long)owner_in->max_version);
        NT_STATUS_HAVE_NO_MEMORY(filter);
-       ret = ldb_search(service->wins_db->ldb, NULL, LDB_SCOPE_SUBTREE, filter, NULL, &res);
+       ret = ldb_search(service->wins_db->ldb, call, &res, NULL, LDB_SCOPE_SUBTREE, NULL, "%s", filter);
        if (ret != LDB_SUCCESS) return NT_STATUS_INTERNAL_DB_CORRUPTION;
-       talloc_steal(call, res);
        DEBUG(10,("WINSREPL: filter '%s' count %d\n", filter, res->count));
 
        if (res->count == 0) {
@@ -447,7 +445,7 @@ static NTSTATUS wreplsrv_in_replication(struct wreplsrv_in_call *call)
        switch (repl_in->command) {
                case WREPL_REPL_TABLE_QUERY:
                        if (!(call->wreplconn->partner->type & WINSREPL_PARTNER_PUSH)) {
-                               DEBUG(2,("Failing WINS replication TABLE_QUERY from non-push-partner %s\n",
+                               DEBUG(0,("Failing WINS replication TABLE_QUERY from non-push-partner %s\n",
                                         call->wreplconn->partner->address));
                                return wreplsrv_in_stop_assoc_ctx(call);
                        }
@@ -459,7 +457,7 @@ static NTSTATUS wreplsrv_in_replication(struct wreplsrv_in_call *call)
 
                case WREPL_REPL_SEND_REQUEST:
                        if (!(call->wreplconn->partner->type & WINSREPL_PARTNER_PUSH)) {
-                               DEBUG(2,("Failing WINS replication SEND_REQUESET from non-push-partner %s\n",
+                               DEBUG(0,("Failing WINS replication SEND_REQUESET from non-push-partner %s\n",
                                         call->wreplconn->partner->address));
                                return wreplsrv_in_stop_assoc_ctx(call);
                        }
@@ -471,7 +469,7 @@ static NTSTATUS wreplsrv_in_replication(struct wreplsrv_in_call *call)
        
                case WREPL_REPL_UPDATE:
                        if (!(call->wreplconn->partner->type & WINSREPL_PARTNER_PULL)) {
-                               DEBUG(2,("Failing WINS replication UPDATE from non-pull-partner %s\n",
+                               DEBUG(0,("Failing WINS replication UPDATE from non-pull-partner %s\n",
                                         call->wreplconn->partner->address));
                                return wreplsrv_in_stop_assoc_ctx(call);
                        }
@@ -480,7 +478,7 @@ static NTSTATUS wreplsrv_in_replication(struct wreplsrv_in_call *call)
 
                case WREPL_REPL_UPDATE2:
                        if (!(call->wreplconn->partner->type & WINSREPL_PARTNER_PULL)) {
-                               DEBUG(2,("Failing WINS replication UPDATE2 from non-pull-partner %s\n",
+                               DEBUG(0,("Failing WINS replication UPDATE2 from non-pull-partner %s\n",
                                         call->wreplconn->partner->address));
                                return wreplsrv_in_stop_assoc_ctx(call);
                        }
@@ -489,7 +487,7 @@ static NTSTATUS wreplsrv_in_replication(struct wreplsrv_in_call *call)
 
                case WREPL_REPL_INFORM:
                        if (!(call->wreplconn->partner->type & WINSREPL_PARTNER_PULL)) {
-                               DEBUG(2,("Failing WINS replication INFORM from non-pull-partner %s\n",
+                               DEBUG(0,("Failing WINS replication INFORM from non-pull-partner %s\n",
                                         call->wreplconn->partner->address));
                                return wreplsrv_in_stop_assoc_ctx(call);
                        }
@@ -498,7 +496,7 @@ static NTSTATUS wreplsrv_in_replication(struct wreplsrv_in_call *call)
 
                case WREPL_REPL_INFORM2:
                        if (!(call->wreplconn->partner->type & WINSREPL_PARTNER_PULL)) {
-                               DEBUG(2,("Failing WINS replication INFORM2 from non-pull-partner %s\n",
+                               DEBUG(0,("Failing WINS replication INFORM2 from non-pull-partner %s\n",
                                         call->wreplconn->partner->address));
                                return wreplsrv_in_stop_assoc_ctx(call);
                        }