tldap: Add tldap_pending_reqs()
authorVolker Lendecke <vl@samba.org>
Sun, 31 Jan 2016 14:15:46 +0000 (15:15 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 3 Feb 2016 14:04:11 +0000 (15:04 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/lib/tldap.c

index 3072482843a71f830cfbc7b71d4bbe72fa040d7d..12203236b67c11939ec0aca31b1fe8d9ae154ba1 100644 (file)
@@ -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);