summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/extended_dn.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-05-29 01:30:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:41 -0500
commit3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5 (patch)
tree7d34281bba70aaa79d7527b823f00f625836dc3a /source4/dsdb/samdb/ldb_modules/extended_dn.c
parent0bd3636a1249dd55f7595c06892e2db65af18bfc (diff)
downloadsamba-3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5.tar.gz
samba-3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5.tar.bz2
samba-3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5.zip
r15927: Optimize ldb module traverse while keeping the API intact.
I was sick of jumping inot each module for each request, even the ones not handle by that module. (This used to be commit 7d65105e885a28584e8555453b90232c43a92bf7)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/extended_dn.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/extended_dn.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn.c b/source4/dsdb/samdb/ldb_modules/extended_dn.c
index e421f7d13c..520ffde32d 100644
--- a/source4/dsdb/samdb/ldb_modules/extended_dn.c
+++ b/source4/dsdb/samdb/ldb_modules/extended_dn.c
@@ -290,8 +290,9 @@ error:
return LDB_ERR_OPERATIONS_ERROR;
}
-static int extended_search_async(struct ldb_module *module, struct ldb_control *control, struct ldb_request *req)
+static int extended_search_async(struct ldb_module *module, struct ldb_request *req)
{
+ struct ldb_control *control;
struct ldb_extended_dn_control *extended_ctrl;
struct ldb_control **saved_controls;
struct extended_async_context *ac;
@@ -299,6 +300,13 @@ static int extended_search_async(struct ldb_module *module, struct ldb_control *
char **new_attrs;
int ret;
+ /* check if there's an extended dn control */
+ control = get_control_from_list(req->controls, LDB_CONTROL_EXTENDED_DN_OID);
+ if (control == NULL) {
+ /* not found go on */
+ return ldb_next_request(module, req);
+ }
+
extended_ctrl = talloc_get_type(control->data, struct ldb_extended_dn_control);
if (!extended_ctrl) {
return LDB_ERR_PROTOCOL_ERROR;
@@ -397,9 +405,6 @@ static int extended_request(struct ldb_module *module, struct ldb_request *req)
case LDB_REQ_SEARCH:
return extended_search(module, control, req);
- case LDB_ASYNC_SEARCH:
- return extended_search_async(module, control, req);
-
default:
return LDB_ERR_OPERATIONS_ERROR;
@@ -433,6 +438,7 @@ static int extended_init(struct ldb_module *module)
static const struct ldb_module_ops extended_dn_ops = {
.name = "extended_dn",
+ .search = extended_search_async,
.request = extended_request,
.init_context = extended_init
};