예제 #1
0
/*The following function is not thread safe! Should called only when c-icap shutdown*/
void ldap_pool_destroy(struct ldap_connections_pool *pool)
{
    struct ldap_connection *conn,*prev;
    if(pool->used) {
        ci_debug_printf(1,"Not released ldap connections for pool %s.This is BUG!\n",
                        pool->ldap_uri);
    }
    conn = pool->inactive;

    while(conn) {
        ldap_unbind_ext_s(conn->ldap, NULL, NULL);
        prev = conn;
        conn = conn->next;
        free(prev);
    }
    pool->inactive = NULL;

    ci_thread_mutex_destroy(&pool->mutex);
#ifdef LDAP_MAX_CONNECTIONS
    ci_thread_cond_destroy(&pool->pool_cond);
#endif
    free(pool);
}
예제 #2
0
void destroy_queue(struct connections_queue *q){
     ci_thread_mutex_destroy(&(q->queue_mtx));
     ci_thread_cond_destroy(&(q->queue_cond));
     free(q->connections);
     free(q);
}