From: Eric Covener Date: Mon, 28 Mar 2011 22:40:20 +0000 (+0000) Subject: fix incorrect type of LDAP connection pool member, fix naming fors X-Git-Tag: 2.3.12~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4355155ced54b9c028ebfbfd75872a2feb1a310b;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/include/ap_mmn.h b/include/ap_mmn.h index fbc9dfd5fcd..097d5decb2b 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -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 diff --git a/include/util_ldap.h b/include/util_ldap.h index f3639b61bd9..18c990dbf50 100644 --- a/include/util_ldap.h +++ b/include/util_ldap.h @@ -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. */ diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index dc8291b97c8..a31d583b41a 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -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; }