Skip to content

Commit

Permalink
lib-dict: Disable debug log unless debug enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse committed Apr 13, 2016
1 parent d3be014 commit 45fee9d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lib-dict/dict-ldap.c
Expand Up @@ -297,15 +297,18 @@ ldap_dict_lookup_callback(struct ldap_result *result, struct dict_ldap_op *op)
iter = ldap_search_iterator_init(result);
entry = ldap_search_iterator_next(iter);
if (entry != NULL) {
i_debug("ldap_dict_lookup_callback got dn %s", ldap_entry_dn(entry));
if (op->dict->set->debug > 0)
i_debug("ldap_dict_lookup_callback got dn %s", ldap_entry_dn(entry));
/* try extract value */
const char *const *values = ldap_entry_get_attribute(entry, op->map->value_attribute);
if (values != NULL) {
i_debug("ldap_dict_lookup_callback got attribute %s", op->map->value_attribute);
if (op->dict->set->debug > 0)
i_debug("ldap_dict_lookup_callback got attribute %s", op->map->value_attribute);
op->res.ret = 1;
op->res.value = p_strdup(op->pool, values[0]);
} else {
i_debug("ldap_dict_lookup_callback dit not get attribute %s", op->map->value_attribute);
if (op->dict->set->debug > 0)
i_debug("ldap_dict_lookup_callback dit not get attribute %s", op->map->value_attribute);
op->res.value = NULL;
}
}
Expand Down

0 comments on commit 45fee9d

Please sign in to comment.