From 4ad0397d8afdd6bec609506f3736f8567afe7564 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 23 Oct 2009 14:27:00 +1100 Subject: s4-ldbwrap: added re-use of ldb contexts in ldb_wrap_connect() This allows us to reuse a ldb context if it is open twice, instead of going through the expensive process of a full ldb open. We can reuse it if all of the parameters are the same. The change relies on callers using talloc_unlink() or free of a parent to close a ldb context. --- source4/nbt_server/wins/winsdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/nbt_server') diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c index a502050299..56ba146be1 100644 --- a/source4/nbt_server/wins/winsdb.c +++ b/source4/nbt_server/wins/winsdb.c @@ -980,7 +980,7 @@ static bool winsdb_check_or_add_module_list(struct tevent_context *ev_ctx, } h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lp_wins_url(lp_ctx)), - NULL, NULL, flags, NULL); + NULL, NULL, flags); if (!h->ldb) goto failed; talloc_free(tmp_ctx); @@ -1016,7 +1016,7 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx, } h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lp_wins_url(lp_ctx)), - NULL, NULL, flags, NULL); + NULL, NULL, flags); if (!h->ldb) goto failed; h->caller = caller; -- cgit