summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2016-01-31 15:15:46 +0100
committerGünther Deschner <gd@samba.org>2016-02-03 15:04:11 +0100
commit0d1165a4241c67f88d5f0f1b718e29597698d515 (patch)
tree859dbdafca02cd3602372b343e3289e5f494a1e2 /source3/lib
parentd29c45ce41c3360726b67e4683703b9eb433e29d (diff)
downloadsamba-0d1165a4241c67f88d5f0f1b718e29597698d515.tar.gz
tldap: Add tldap_pending_reqs()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/tldap.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c
index 3072482843a..12203236b67 100644
--- a/source3/lib/tldap.c
+++ b/source3/lib/tldap.c
@@ -191,6 +191,11 @@ bool tldap_connection_ok(struct tldap_context *ld)
return !ld->server_down;
}
+static size_t tldap_pending_reqs(struct tldap_context *ld)
+{
+ return talloc_array_length(ld->pending);
+}
+
static struct tldap_ctx_attribute *tldap_context_findattr(
struct tldap_context *ld, const char *name)
{
@@ -471,7 +476,7 @@ static void tldap_msg_unset_pending(struct tevent_req *req)
struct tldap_msg_state *state = tevent_req_data(
req, struct tldap_msg_state);
struct tldap_context *ld = state->ld;
- int num_pending = talloc_array_length(ld->pending);
+ int num_pending = tldap_pending_reqs(ld);
int i;
tevent_req_set_cleanup_fn(req, NULL);
@@ -533,7 +538,7 @@ static bool tldap_msg_set_pending(struct tevent_req *req)
struct tevent_req *subreq;
ld = state->ld;
- num_pending = talloc_array_length(ld->pending);
+ num_pending = tldap_pending_reqs(ld);
pending = talloc_realloc(ld, ld->pending, struct tevent_req *,
num_pending+1);