mirror of
https://github.com/apache/httpd.git
synced 2025-08-07 04:02:58 +03:00
* modules/ldap/util_ldap_cache.c: Remove various casts-from-void *,
fix various minor style nits. No functional changes. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@226820 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -33,22 +33,22 @@
|
||||
|
||||
unsigned long util_ldap_url_node_hash(void *n)
|
||||
{
|
||||
util_url_node_t *node = (util_url_node_t *)n;
|
||||
util_url_node_t *node = n;
|
||||
return util_ald_hash_string(1, node->url);
|
||||
}
|
||||
|
||||
int util_ldap_url_node_compare(void *a, void *b)
|
||||
{
|
||||
util_url_node_t *na = (util_url_node_t *)a;
|
||||
util_url_node_t *nb = (util_url_node_t *)b;
|
||||
util_url_node_t *na = a;
|
||||
util_url_node_t *nb = b;
|
||||
|
||||
return(strcmp(na->url, nb->url) == 0);
|
||||
return (strcmp(na->url, nb->url) == 0);
|
||||
}
|
||||
|
||||
void *util_ldap_url_node_copy(util_ald_cache_t *cache, void *c)
|
||||
{
|
||||
util_url_node_t *n = (util_url_node_t *)c;
|
||||
util_url_node_t *node = (util_url_node_t *)util_ald_alloc(cache, sizeof(util_url_node_t));
|
||||
util_url_node_t *n = c;
|
||||
util_url_node_t *node = util_ald_alloc(cache, sizeof *node);
|
||||
|
||||
if (node) {
|
||||
if (!(node->url = util_ald_strdup(cache, n->url))) {
|
||||
@@ -67,7 +67,7 @@ void *util_ldap_url_node_copy(util_ald_cache_t *cache, void *c)
|
||||
|
||||
void util_ldap_url_node_free(util_ald_cache_t *cache, void *n)
|
||||
{
|
||||
util_url_node_t *node = (util_url_node_t *)n;
|
||||
util_url_node_t *node = n;
|
||||
|
||||
util_ald_free(cache, node->url);
|
||||
util_ald_destroy_cache(node->search_cache);
|
||||
@@ -78,7 +78,7 @@ void util_ldap_url_node_free(util_ald_cache_t *cache, void *n)
|
||||
|
||||
void util_ldap_url_node_display(request_rec *r, util_ald_cache_t *cache, void *n)
|
||||
{
|
||||
util_url_node_t *node = (util_url_node_t *)n;
|
||||
util_url_node_t *node = n;
|
||||
char date_str[APR_CTIME_LEN+1];
|
||||
char *buf;
|
||||
const char *type_str;
|
||||
@@ -135,20 +135,22 @@ void util_ldap_url_node_display(request_rec *r, util_ald_cache_t *cache, void *n
|
||||
/* Cache functions for search nodes */
|
||||
unsigned long util_ldap_search_node_hash(void *n)
|
||||
{
|
||||
util_search_node_t *node = (util_search_node_t *)n;
|
||||
return util_ald_hash_string(1, ((util_search_node_t *)(node))->username);
|
||||
util_search_node_t *node = n;
|
||||
return util_ald_hash_string(1, node->username);
|
||||
}
|
||||
|
||||
int util_ldap_search_node_compare(void *a, void *b)
|
||||
{
|
||||
return(strcmp(((util_search_node_t *)a)->username,
|
||||
((util_search_node_t *)b)->username) == 0);
|
||||
util_search_node_t *na = a;
|
||||
util_search_node_t *nb = b;
|
||||
|
||||
return (strcmp(na->username, nb->username) == 0);
|
||||
}
|
||||
|
||||
void *util_ldap_search_node_copy(util_ald_cache_t *cache, void *c)
|
||||
{
|
||||
util_search_node_t *node = (util_search_node_t *)c;
|
||||
util_search_node_t *newnode = util_ald_alloc(cache, sizeof(util_search_node_t));
|
||||
util_search_node_t *node = c;
|
||||
util_search_node_t *newnode = util_ald_alloc(cache, sizeof *newnode);
|
||||
|
||||
/* safety check */
|
||||
if (newnode) {
|
||||
@@ -199,8 +201,9 @@ void *util_ldap_search_node_copy(util_ald_cache_t *cache, void *c)
|
||||
void util_ldap_search_node_free(util_ald_cache_t *cache, void *n)
|
||||
{
|
||||
int i = 0;
|
||||
util_search_node_t *node = (util_search_node_t *)n;
|
||||
util_search_node_t *node = n;
|
||||
int k = node->numvals;
|
||||
|
||||
if (node->vals) {
|
||||
for (;k;k--,i++) {
|
||||
if (node->vals[i]) {
|
||||
@@ -217,7 +220,7 @@ void util_ldap_search_node_free(util_ald_cache_t *cache, void *n)
|
||||
|
||||
void util_ldap_search_node_display(request_rec *r, util_ald_cache_t *cache, void *n)
|
||||
{
|
||||
util_search_node_t *node = (util_search_node_t *)n;
|
||||
util_search_node_t *node = n;
|
||||
char date_str[APR_CTIME_LEN+1];
|
||||
char *buf;
|
||||
|
||||
@@ -240,14 +243,15 @@ void util_ldap_search_node_display(request_rec *r, util_ald_cache_t *cache, void
|
||||
|
||||
unsigned long util_ldap_compare_node_hash(void *n)
|
||||
{
|
||||
util_compare_node_t *node = (util_compare_node_t *)n;
|
||||
util_compare_node_t *node = n;
|
||||
return util_ald_hash_string(3, node->dn, node->attrib, node->value);
|
||||
}
|
||||
|
||||
int util_ldap_compare_node_compare(void *a, void *b)
|
||||
{
|
||||
util_compare_node_t *na = (util_compare_node_t *)a;
|
||||
util_compare_node_t *nb = (util_compare_node_t *)b;
|
||||
util_compare_node_t *na = a;
|
||||
util_compare_node_t *nb = b;
|
||||
|
||||
return (strcmp(na->dn, nb->dn) == 0 &&
|
||||
strcmp(na->attrib, nb->attrib) == 0 &&
|
||||
strcmp(na->value, nb->value) == 0);
|
||||
@@ -255,8 +259,8 @@ int util_ldap_compare_node_compare(void *a, void *b)
|
||||
|
||||
void *util_ldap_compare_node_copy(util_ald_cache_t *cache, void *c)
|
||||
{
|
||||
util_compare_node_t *n = (util_compare_node_t *)c;
|
||||
util_compare_node_t *node = (util_compare_node_t *)util_ald_alloc(cache, sizeof(util_compare_node_t));
|
||||
util_compare_node_t *n = c;
|
||||
util_compare_node_t *node = util_ald_alloc(cache, sizeof *node);
|
||||
|
||||
if (node) {
|
||||
if (!(node->dn = util_ald_strdup(cache, n->dn)) ||
|
||||
@@ -276,7 +280,7 @@ void *util_ldap_compare_node_copy(util_ald_cache_t *cache, void *c)
|
||||
|
||||
void util_ldap_compare_node_free(util_ald_cache_t *cache, void *n)
|
||||
{
|
||||
util_compare_node_t *node = (util_compare_node_t *)n;
|
||||
util_compare_node_t *node = n;
|
||||
util_ald_free(cache, node->dn);
|
||||
util_ald_free(cache, node->attrib);
|
||||
util_ald_free(cache, node->value);
|
||||
@@ -285,7 +289,7 @@ void util_ldap_compare_node_free(util_ald_cache_t *cache, void *n)
|
||||
|
||||
void util_ldap_compare_node_display(request_rec *r, util_ald_cache_t *cache, void *n)
|
||||
{
|
||||
util_compare_node_t *node = (util_compare_node_t *)n;
|
||||
util_compare_node_t *node = n;
|
||||
char date_str[APR_CTIME_LEN+1];
|
||||
char *buf, *cmp_result;
|
||||
|
||||
@@ -322,19 +326,23 @@ void util_ldap_compare_node_display(request_rec *r, util_ald_cache_t *cache, voi
|
||||
|
||||
unsigned long util_ldap_dn_compare_node_hash(void *n)
|
||||
{
|
||||
return util_ald_hash_string(1, ((util_dn_compare_node_t *)n)->reqdn);
|
||||
util_dn_compare_node_t *node = n;
|
||||
return util_ald_hash_string(1, node->reqdn);
|
||||
}
|
||||
|
||||
int util_ldap_dn_compare_node_compare(void *a, void *b)
|
||||
{
|
||||
return (strcmp(((util_dn_compare_node_t *)a)->reqdn,
|
||||
((util_dn_compare_node_t *)b)->reqdn) == 0);
|
||||
util_dn_compare_node_t *na = a;
|
||||
util_dn_compare_node_t *nb = b;
|
||||
|
||||
return (strcmp(na->reqdn, nb->reqdn) == 0);
|
||||
}
|
||||
|
||||
void *util_ldap_dn_compare_node_copy(util_ald_cache_t *cache, void *c)
|
||||
{
|
||||
util_dn_compare_node_t *n = (util_dn_compare_node_t *)c;
|
||||
util_dn_compare_node_t *node = (util_dn_compare_node_t *)util_ald_alloc(cache, sizeof(util_dn_compare_node_t));
|
||||
util_dn_compare_node_t *n = c;
|
||||
util_dn_compare_node_t *node = util_ald_alloc(cache, sizeof *node);
|
||||
|
||||
if (node) {
|
||||
if (!(node->reqdn = util_ald_strdup(cache, n->reqdn)) ||
|
||||
!(node->dn = util_ald_strdup(cache, n->dn))) {
|
||||
@@ -350,7 +358,7 @@ void *util_ldap_dn_compare_node_copy(util_ald_cache_t *cache, void *c)
|
||||
|
||||
void util_ldap_dn_compare_node_free(util_ald_cache_t *cache, void *n)
|
||||
{
|
||||
util_dn_compare_node_t *node = (util_dn_compare_node_t *)n;
|
||||
util_dn_compare_node_t *node = n;
|
||||
util_ald_free(cache, node->reqdn);
|
||||
util_ald_free(cache, node->dn);
|
||||
util_ald_free(cache, node);
|
||||
@@ -358,7 +366,7 @@ void util_ldap_dn_compare_node_free(util_ald_cache_t *cache, void *n)
|
||||
|
||||
void util_ldap_dn_compare_node_display(request_rec *r, util_ald_cache_t *cache, void *n)
|
||||
{
|
||||
util_dn_compare_node_t *node = (util_dn_compare_node_t *)n;
|
||||
util_dn_compare_node_t *node = n;
|
||||
char *buf;
|
||||
|
||||
buf = apr_psprintf(r->pool,
|
||||
@@ -376,7 +384,7 @@ void util_ldap_dn_compare_node_display(request_rec *r, util_ald_cache_t *cache,
|
||||
/* ------------------------------------------------------------------ */
|
||||
static apr_status_t util_ldap_cache_module_kill(void *data)
|
||||
{
|
||||
util_ldap_state_t *st = (util_ldap_state_t *)data;
|
||||
util_ldap_state_t *st = data;
|
||||
|
||||
util_ald_destroy_cache(st->util_ldap_cache);
|
||||
#if APR_HAS_SHARED_MEMORY
|
||||
|
Reference in New Issue
Block a user