diff options
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 */ |