Commit 389692d3 authored by Eric Covener's avatar Eric Covener
Browse files

fix incorrect type of LDAP connection pool member, fix naming fors

style guidlines



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086432 13f79535-47bb-0310-9956-ffa450edef68
parent 8f95eb6e
Loading
Loading
Loading
Loading
+4 −2
Changes for include/ap_mmn.h: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -307,14 +307,16 @@
                           util_ldap_connection_t.freed, and
                           util_ldap_connection_t.rebind_pool. 
 * 20110312.1 (2.3.12-dev) Add core_dir_config.decode_encoded_slashes.
 * 20110328.0 (2.3.12-dev) change type and name of connectionPoolTTL in util_ldap_state_t 
                           connectionPoolTTL (connection_pool_ttl, int->apr_interval_t)
 */

#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */

#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20110312
#define MODULE_MAGIC_NUMBER_MAJOR 20110328
#endif
#define MODULE_MAGIC_NUMBER_MINOR 1                     /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 0                    /* 0...n */

/**
 * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+1 −1
Changes for include/util_ldap.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ typedef struct util_ldap_state_t {
    struct timeval *opTimeout;

    int debug_level;                    /* SDK debug level */
    int connectionPoolTTL;
    apr_interval_time_t connection_pool_ttl;
} util_ldap_state_t;

/* Used to store arrays of attribute labels/values. */
+8 −8
Changes for modules/ldap/util_ldap.c: 8 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -668,8 +668,8 @@ static util_ldap_connection_t *
            && (l->deref == deref) && (l->secure == secureflag)
            && !compare_client_certs(dc->client_certs, l->client_certs))
        {
            if (st->connectionPoolTTL > 0) { 
                if (l->bound && (now - l->freed) > st->connectionPoolTTL) { 
            if (st->connection_pool_ttl > 0) { 
                if (l->bound && (now - l->freed) > st->connection_pool_ttl) { 
                    ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, 
                                  "Removing LDAP connection last used %" APR_TIME_T_FMT " seconds ago", 
                                  (now - l->freed) / APR_USEC_PER_SEC);
@@ -706,7 +706,7 @@ static util_ldap_connection_t *
                !compare_client_certs(dc->client_certs, l->client_certs))
            {
                /* the bind credentials have changed */
                /* no check for connectionPoolTTL, since we are unbinding any way */
                /* no check for connection_pool_ttl, since we are unbinding any way */
                uldap_connection_unbind(l);
                        
                util_ldap_strdup((char**)&(l->binddn), binddn);
@@ -776,7 +776,7 @@ static util_ldap_connection_t *
        l->client_certs = apr_array_copy_hdr(l->pool, dc->client_certs);

        /* whether or not to keep this connection in the pool when it's returned */
        l->keep = (st->connectionPoolTTL == 0) ? 0 : 1;
        l->keep = (st->connection_pool_ttl == 0) ? 0 : 1;

        if (l->ChaseReferrals == AP_LDAP_CHASEREFERRALS_ON) { 
            if (apr_pool_create(&(l->rebind_pool), l->pool) != APR_SUCCESS) {
@@ -2590,7 +2590,7 @@ static const char *util_ldap_set_conn_ttl(cmd_parms *cmd,
        /* reserve -1 for default value */
        timeout =  AP_LDAP_CONNPOOL_INFINITE;
    }
    st->connectionPoolTTL = timeout;
    st->connection_pool_ttl = timeout;
    return NULL;
}

@@ -2624,7 +2624,7 @@ static void *util_ldap_create_config(apr_pool_t *p, server_rec *s)
    st->opTimeout = apr_pcalloc(p, sizeof(struct timeval));
    st->opTimeout->tv_sec = 60;
    st->verify_svr_cert = 1;
    st->connectionPoolTTL = AP_LDAP_CONNPOOL_DEFAULT; /* no limit */
    st->connection_pool_ttl = AP_LDAP_CONNPOOL_DEFAULT; /* no limit */

    return st;
}
@@ -2676,8 +2676,8 @@ static void *util_ldap_merge_config(apr_pool_t *p, void *basev,
    st->verify_svr_cert = base->verify_svr_cert;
    st->debug_level = base->debug_level;

    st->connectionPoolTTL = (overrides->connectionPoolTTL == AP_LDAP_CONNPOOL_DEFAULT) ? 
                                base->connectionPoolTTL : overrides->connectionPoolTTL;
    st->connection_pool_ttl = (overrides->connection_pool_ttl == AP_LDAP_CONNPOOL_DEFAULT) ? 
                                base->connection_pool_ttl : overrides->connection_pool_ttl;

    return st;
}