s4-dsdb: added dsdb_next_callback()
authorAndrew Tridgell <tridge@samba.org>
Tue, 5 Jan 2010 22:21:21 +0000 (09:21 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 8 Jan 2010 02:02:59 +0000 (13:02 +1100)
This should be used when you create a sub request and just want the
parent requests callback to be called when done.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/dsdb/samdb/ldb_modules/util.c

index f64216039709f96735309687136982516de06f85..09b41a254bce73265d7b78ca3e824b35439d7df5 100644 (file)
@@ -585,3 +585,15 @@ int dsdb_module_constrainted_update_integer(struct ldb_module *module, struct ld
        talloc_free(msg);
        return ret;
 }
+
+/*
+  used to chain to the callers callback
+ */
+int dsdb_next_callback(struct ldb_request *req, struct ldb_reply *ares)
+{
+       struct ldb_request *up_req = talloc_get_type(req->context, struct ldb_request);
+
+       talloc_steal(up_req, req);
+       return up_req->callback(up_req, ares);
+}
+