diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-11-07 13:22:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:45:52 -0500 |
commit | c643b10d09f0083f3bcb437b0960e5053b6f5a64 (patch) | |
tree | 83bd5823e232add53158da14340df71458990623 /source4 | |
parent | c4a0e36143fed4ca2ba29ddc1b52dd6e22d713fb (diff) | |
download | samba-c643b10d09f0083f3bcb437b0960e5053b6f5a64.tar.gz samba-c643b10d09f0083f3bcb437b0960e5053b6f5a64.tar.xz samba-c643b10d09f0083f3bcb437b0960e5053b6f5a64.zip |
r11547: - don't do pull replication when pullIntervall is 0
- don't do push replication when pushChangeCount is 0
metze
(This used to be commit 4122e9ec3a4394738fa3c261dc92938ea86c3822)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/wrepl_server/wrepl_out_connection.c | 4 | ||||
-rw-r--r-- | source4/wrepl_server/wrepl_server.c | 17 | ||||
-rw-r--r-- | source4/wrepl_server/wrepl_server.h | 2 |
3 files changed, 14 insertions, 9 deletions
diff --git a/source4/wrepl_server/wrepl_out_connection.c b/source4/wrepl_server/wrepl_out_connection.c index 0d5bfda185..e1bade5f87 100644 --- a/source4/wrepl_server/wrepl_out_connection.c +++ b/source4/wrepl_server/wrepl_out_connection.c @@ -236,12 +236,12 @@ NTSTATUS wreplsrv_setup_out_connections(struct wreplsrv_service *service) struct wreplsrv_partner *cur; for (cur = service->partners; cur; cur = cur->next) { - if (cur->type & WINSREPL_PARTNER_PULL) { + if ((cur->type & WINSREPL_PARTNER_PULL) && cur->pull.interval) { cur->pull.te = event_add_timed(service->task->event_ctx, cur, timeval_zero(), wreplsrv_pull_handler_te, cur); NT_STATUS_HAVE_NO_MEMORY(cur->pull.te); } - if (cur->type & WINSREPL_PARTNER_PUSH) { + if ((cur->type & WINSREPL_PARTNER_PUSH) && cur->push.change_count) { cur->push.te = event_add_timed(service->task->event_ctx, cur, timeval_zero(), wreplsrv_push_handler_te, cur); NT_STATUS_HAVE_NO_MEMORY(cur->push.te); diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c index 06a323d103..f4c44c55c0 100644 --- a/source4/wrepl_server/wrepl_server.c +++ b/source4/wrepl_server/wrepl_server.c @@ -84,14 +84,17 @@ static NTSTATUS wreplsrv_load_partners(struct wreplsrv_service *service) if (partner == NULL) goto failed; partner->service = service; - partner->address = ldb_msg_find_string(res[i], "address", NULL); + partner->address = ldb_msg_find_string(res[i], "address", NULL); if (!partner->address) goto failed; - partner->name = ldb_msg_find_string(res[i], "name", partner->address); - partner->type = ldb_msg_find_int(res[i], "type", WINSREPL_PARTNER_BOTH); - partner->pull.interval = ldb_msg_find_int(res[i], "pullInterval", WINSREPL_DEFAULT_PULL_INTERVAL); - partner->pull.retry_interval = ldb_msg_find_int(res[i], "pullRetryInterval", - WINSREPL_DEFAULT_PULL_RETRY_INTERVAL); - partner->our_address = ldb_msg_find_string(res[i], "ourAddress", NULL); + partner->name = ldb_msg_find_string(res[i], "name", partner->address); + partner->type = ldb_msg_find_uint(res[i], "type", WINSREPL_PARTNER_BOTH); + partner->pull.interval = ldb_msg_find_uint(res[i], "pullInterval", + WINSREPL_DEFAULT_PULL_INTERVAL); + partner->pull.retry_interval = ldb_msg_find_uint(res[i], "pullRetryInterval", + WINSREPL_DEFAULT_PULL_RETRY_INTERVAL); + partner->our_address = ldb_msg_find_string(res[i], "ourAddress", NULL); + partner->push.change_count = ldb_msg_find_uint(res[i], "pushChangeCount", + WINSREPL_DEFAULT_PUSH_CHANGE_COUNT); talloc_steal(partner, partner->address); talloc_steal(partner, partner->name); diff --git a/source4/wrepl_server/wrepl_server.h b/source4/wrepl_server/wrepl_server.h index 63603c823d..d7d71b6175 100644 --- a/source4/wrepl_server/wrepl_server.h +++ b/source4/wrepl_server/wrepl_server.h @@ -125,6 +125,8 @@ enum winsrepl_partner_type { #define WINSREPL_DEFAULT_PULL_INTERVAL (30*60) #define WINSREPL_DEFAULT_PULL_RETRY_INTERVAL (30) +#define WINSREPL_DEFAULT_PUSH_CHANGE_COUNT (0) + /* this represents one of our configured partners */ |