diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-09-21 18:15:19 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-09-22 17:10:05 -0700 |
commit | 2e98ee0907474990e2929c892f5ead731d7ddb34 (patch) | |
tree | 414c7d36736a0787e3e54228646fe55e8a067d0f /source4/lib/ldb/common/ldb_modules.c | |
parent | ec5d01278a6f38f76eb6edfa2e9bfb2fc8eb6fbe (diff) | |
download | samba-2e98ee0907474990e2929c892f5ead731d7ddb34.tar.gz samba-2e98ee0907474990e2929c892f5ead731d7ddb34.tar.bz2 samba-2e98ee0907474990e2929c892f5ead731d7ddb34.zip |
s4-ldb: only show the outer level of ldb ops when tracing
Diffstat (limited to 'source4/lib/ldb/common/ldb_modules.c')
-rw-r--r-- | source4/lib/ldb/common/ldb_modules.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c index 997d373653..ea29a09a2a 100644 --- a/source4/lib/ldb/common/ldb_modules.c +++ b/source4/lib/ldb/common/ldb_modules.c @@ -540,6 +540,8 @@ int ldb_next_request(struct ldb_module *module, struct ldb_request *request) return LDB_ERR_UNWILLING_TO_PERFORM; } + request->handle->nesting++; + switch (request->operation) { case LDB_SEARCH: FIND_OP(module, search); @@ -570,6 +572,9 @@ int ldb_next_request(struct ldb_module *module, struct ldb_request *request) ret = module->ops->request(module, request); break; } + + request->handle->nesting--; + if (ret == LDB_SUCCESS) { return ret; } @@ -672,7 +677,8 @@ int ldb_module_send_entry(struct ldb_request *req, ares->controls = talloc_steal(ares, ctrls); ares->error = LDB_SUCCESS; - if (req->handle->ldb->flags & LDB_FLG_ENABLE_TRACING) { + if ((req->handle->ldb->flags & LDB_FLG_ENABLE_TRACING) && + req->handle->nesting == 0) { char *s; ldb_debug_add(req->handle->ldb, "ldb_trace_response: ENTRY\n"); s = ldb_ldif_message_string(req->handle->ldb, msg, LDB_CHANGETYPE_NONE, msg); @@ -706,7 +712,8 @@ int ldb_module_send_referral(struct ldb_request *req, ares->referral = talloc_steal(ares, ref); ares->error = LDB_SUCCESS; - if (req->handle->ldb->flags & LDB_FLG_ENABLE_TRACING) { + if ((req->handle->ldb->flags & LDB_FLG_ENABLE_TRACING) && + req->handle->nesting == 0) { ldb_debug_add(req->handle->ldb, "ldb_trace_response: REFERRAL\n"); ldb_debug_add(req->handle->ldb, "ref: %s\n", ref); ldb_debug_end(req->handle->ldb, LDB_DEBUG_TRACE); @@ -744,7 +751,8 @@ int ldb_module_done(struct ldb_request *req, req->handle->flags |= LDB_HANDLE_FLAG_DONE_CALLED; - if (req->handle->ldb->flags & LDB_FLG_ENABLE_TRACING) { + if ((req->handle->ldb->flags & LDB_FLG_ENABLE_TRACING) && + req->handle->nesting == 0) { ldb_debug_add(req->handle->ldb, "ldb_trace_response: DONE\n"); ldb_debug_add(req->handle->ldb, "error: %u\n", error); if (ldb_errstring(req->handle->ldb)) { |