svn commit: samba r7779 - in branches/SAMBA_4_0/source/lib: .

tridge at samba.org tridge at samba.org
Mon Jun 20 05:04:45 GMT 2005


Author: tridge
Date: 2005-06-20 05:04:45 +0000 (Mon, 20 Jun 2005)
New Revision: 7779

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7779

Log:
use the parent event context in ldb_wrap_connect(). See the comment in
the previous commit for the method.


Modified:
   branches/SAMBA_4_0/source/lib/db_wrap.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/db_wrap.c
===================================================================
--- branches/SAMBA_4_0/source/lib/db_wrap.c	2005-06-20 05:03:54 UTC (rev 7778)
+++ branches/SAMBA_4_0/source/lib/db_wrap.c	2005-06-20 05:04:45 UTC (rev 7779)
@@ -82,7 +82,9 @@
 	struct ldb_context *ldb;
 	struct ldb_wrap *w;
 	int ret;
+	struct event_context *ev;
 
+
 	for (w = ldb_list; w; w = w->next) {
 		if (strcmp(url, w->url) == 0) {
 			return talloc_reference(mem_ctx, w->ldb);
@@ -93,6 +95,14 @@
 	if (ldb == NULL) {
 		return NULL;
 	}
+
+	/* we want to use the existing event context if possible. This
+	   relies on the fact that in smbd, everything is a child of
+	   the main event_context */
+	ev = talloc_find_parent_bytype(mem_ctx, struct event_context);
+	if (ev) {
+		ldb_set_opaque(ldb, "EventContext", ev);
+	}
 	
 	ret = ldb_connect(ldb, url, flags, options);
 	if (ret == -1) {



More information about the samba-cvs mailing list