Lines Matching refs:ld_cache
70 if ( ld->ld_cache == NULLLDCACHE ) {
71 if (( ld->ld_cache = (LDAPCache *)malloc( sizeof( LDAPCache )))
79 (void) memset( ld->ld_cache, 0, sizeof( LDAPCache ));
80 ld->ld_cache->lc_memused = sizeof( LDAPCache );
83 ld->ld_cache->lc_timeout = timeout;
84 ld->ld_cache->lc_maxmem = maxmem;
85 check_cache_memused( ld->ld_cache );
86 ld->ld_cache->lc_enabled = 1;
100 if ( ld->ld_cache != NULLLDCACHE ) {
101 ld->ld_cache->lc_enabled = 0;
116 if ( ld->ld_cache != NULLLDCACHE ) {
117 ld->ld_cache->lc_options = opts;
131 if ( ld->ld_cache != NULLLDCACHE ) {
133 free( (char *)ld->ld_cache );
134 ld->ld_cache = NULLLDCACHE;
153 if ( ld->ld_cache != NULLLDCACHE ) {
155 for ( m = ld->ld_cache->lc_requests; m != NULLMSG; m = next ) {
159 ld->ld_cache->lc_requests = NULLMSG;
163 for ( m = ld->ld_cache->lc_buckets[ i ];
168 ld->ld_cache->lc_buckets[ i ] = NULLMSG;
170 ld->ld_cache->lc_memused = sizeof( LDAPCache );
184 Debug( LDAP_DEBUG_TRACE, catgets(slapdcat, 1, 91, "ldap_uncache_request %1$d ld_cache %2$x\n"),
185 msgid, ld->ld_cache, 0 );
200 Debug( LDAP_DEBUG_TRACE, catgets(slapdcat, 1, 92, "ldap_uncache_entry %1$s ld_cache %2$x\n"),
201 dn, ld->ld_cache, 0 );
219 catgets(slapdcat, 1, 93, "ldap_uncache_entry_or_req dn %1$s msgid %2$d ld_cache %3$x\n"),
220 dn, msgid, ld->ld_cache );
222 if ( ld->ld_cache == NULLLDCACHE ) {
228 for ( m = ld->ld_cache->lc_requests; m != NULLMSG; m = next ) {
233 ld->ld_cache->lc_requests = next;
237 ld->ld_cache->lc_memused -= msg_size( m );
247 for ( m = ld->ld_cache->lc_buckets[ i ]; m != NULLMSG;
253 ld->ld_cache->lc_buckets[ i ] = next;
257 ld->ld_cache->lc_memused -= msg_size( m );
276 if ( ld->ld_cache == NULLLDCACHE ||
277 ( ld->ld_cache->lc_enabled == 0 )) {
300 new->lm_next = ld->ld_cache->lc_requests;
301 ld->ld_cache->lc_requests = new;
317 if ( ld->ld_cache == NULLLDCACHE ||
318 ( ld->ld_cache->lc_enabled == 0 )) {
341 for ( m = ld->ld_cache->lc_requests; m != NULL; m = m->lm_next ) {
375 if ( ld->ld_cache->lc_options == 0 ) {
379 } else if (( ld->ld_cache->lc_options &
385 ld->ld_cache->lc_requests = req->lm_next;
396 mp = &ld->ld_cache->lc_buckets[
401 ld->ld_cache->lc_memused += msg_size( req );
402 check_cache_memused( ld->ld_cache );
432 if ( ld->ld_cache == NULLLDCACHE ||
433 ( ld->ld_cache->lc_enabled == 0 )) {
440 validtime = time( NULL ) - ld->ld_cache->lc_timeout;
444 for ( m = ld->ld_cache->lc_buckets[ hash ]; m != NULLMSG; m = next ) {
451 ld->ld_cache->lc_buckets[ hash ] = next;
457 ld->ld_cache->lc_memused -= msg_size( m );