mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Fixed all the #if APR_HAS_SHARED_MEMORY checks within the LDAP
module code to follow APR. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90338 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
4
CHANGES
4
CHANGES
@@ -1,5 +1,8 @@
|
|||||||
Changes with Apache 2.0.25-dev
|
Changes with Apache 2.0.25-dev
|
||||||
|
|
||||||
|
*) Fixed all the #if APR_HAS_SHARED_MEMORY checks within the LDAP
|
||||||
|
module code to follow APR. [Graham Leggett]
|
||||||
|
|
||||||
*) Fixed LDAP cleanup on graceful restarts. LDAP connections are now
|
*) Fixed LDAP cleanup on graceful restarts. LDAP connections are now
|
||||||
cleaned up when the connection pool pool is cleaned up.
|
cleaned up when the connection pool pool is cleaned up.
|
||||||
[Graham Leggett]
|
[Graham Leggett]
|
||||||
@@ -7,6 +10,7 @@ Changes with Apache 2.0.25-dev
|
|||||||
*) Fix a minor issue with Jeff Trawick's mod_include
|
*) Fix a minor issue with Jeff Trawick's mod_include
|
||||||
patch. Without this patch, the code will just allocate
|
patch. Without this patch, the code will just allocate
|
||||||
more bytes in get_combined_directive than are needed.
|
more bytes in get_combined_directive than are needed.
|
||||||
|
[Paul Reder]
|
||||||
|
|
||||||
*) Added the LDAP authentication module mod_auth_ldap.
|
*) Added the LDAP authentication module mod_auth_ldap.
|
||||||
[Dave Carrigan <dave@rudedog.org>, Graham Leggett]
|
[Dave Carrigan <dave@rudedog.org>, Graham Leggett]
|
||||||
|
@@ -217,7 +217,7 @@ apr_status_t util_ldap_cache_module_kill(void *data);
|
|||||||
|
|
||||||
apr_status_t util_ldap_cache_module_kill(void *data)
|
apr_status_t util_ldap_cache_module_kill(void *data)
|
||||||
{
|
{
|
||||||
#ifdef APU_HAS_LDAP_SHARED_CACHE
|
#if APR_HAS_SHARED_MEMORY
|
||||||
if (util_ldap_shm != NULL) {
|
if (util_ldap_shm != NULL) {
|
||||||
apr_status_t result = apr_shm_destroy(util_ldap_shm);
|
apr_status_t result = apr_shm_destroy(util_ldap_shm);
|
||||||
util_ldap_shm = NULL;
|
util_ldap_shm = NULL;
|
||||||
@@ -232,7 +232,7 @@ apr_status_t util_ldap_cache_init(apr_pool_t *pool, apr_size_t reqsize)
|
|||||||
apr_status_t result = APR_SUCCESS;
|
apr_status_t result = APR_SUCCESS;
|
||||||
apr_pool_cleanup_register(pool, NULL, util_ldap_cache_module_kill, apr_pool_cleanup_null);
|
apr_pool_cleanup_register(pool, NULL, util_ldap_cache_module_kill, apr_pool_cleanup_null);
|
||||||
|
|
||||||
#ifdef APU_HAS_LDAP_SHARED_CACHE
|
#if APR_HAS_SHARED_MEMORY
|
||||||
result = apr_shm_init(&util_ldap_shm, reqsize, "/tmp/ldap_cache", pool);
|
result = apr_shm_init(&util_ldap_shm, reqsize, "/tmp/ldap_cache", pool);
|
||||||
#endif
|
#endif
|
||||||
util_ldap_cache = util_ald_create_cache(50,
|
util_ldap_cache = util_ald_create_cache(50,
|
||||||
|
@@ -63,16 +63,12 @@
|
|||||||
/* this whole thing disappears if LDAP is not enabled */
|
/* this whole thing disappears if LDAP is not enabled */
|
||||||
#ifdef APU_HAS_LDAP
|
#ifdef APU_HAS_LDAP
|
||||||
|
|
||||||
/* FIXME */
|
|
||||||
#define APU_HAS_LDAP_SHARED_CACHE
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LDAP Cache Manager
|
* LDAP Cache Manager
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef APU_HAS_LDAP_SHARED_CACHE
|
|
||||||
#include <apr_shmem.h>
|
#include <apr_shmem.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct util_cache_node_t {
|
typedef struct util_cache_node_t {
|
||||||
void *payload; /* Pointer to the payload */
|
void *payload; /* Pointer to the payload */
|
||||||
@@ -105,7 +101,7 @@ typedef struct util_ald_cache_t {
|
|||||||
unsigned long removes; /* Number of removes */
|
unsigned long removes; /* Number of removes */
|
||||||
} util_ald_cache_t;
|
} util_ald_cache_t;
|
||||||
|
|
||||||
#ifdef APU_HAS_LDAP_SHARED_CACHE
|
#if APR_HAS_SHARED_MEMORY
|
||||||
apr_shmem_t *util_ldap_shm;
|
apr_shmem_t *util_ldap_shm;
|
||||||
#endif
|
#endif
|
||||||
util_ald_cache_t *util_ldap_cache;
|
util_ald_cache_t *util_ldap_cache;
|
||||||
|
@@ -114,7 +114,7 @@ static const int primes[] =
|
|||||||
|
|
||||||
void util_ald_free(const void *ptr)
|
void util_ald_free(const void *ptr)
|
||||||
{
|
{
|
||||||
#ifdef APU_HAS_LDAP_SHARED_CACHE
|
#if APR_HAS_SHARED_MEMORY
|
||||||
if (util_ldap_shm) {
|
if (util_ldap_shm) {
|
||||||
apr_shm_free(util_ldap_shm, (void *)ptr);
|
apr_shm_free(util_ldap_shm, (void *)ptr);
|
||||||
} else {
|
} else {
|
||||||
@@ -127,7 +127,7 @@ void util_ald_free(const void *ptr)
|
|||||||
|
|
||||||
void *util_ald_alloc(int size)
|
void *util_ald_alloc(int size)
|
||||||
{
|
{
|
||||||
#ifdef APU_HAS_LDAP_SHARED_CACHE
|
#if APR_HAS_SHARED_MEMORY
|
||||||
if (util_ldap_shm) {
|
if (util_ldap_shm) {
|
||||||
return (void *)apr_shm_malloc(util_ldap_shm, size);
|
return (void *)apr_shm_malloc(util_ldap_shm, size);
|
||||||
} else {
|
} else {
|
||||||
@@ -140,7 +140,7 @@ void *util_ald_alloc(int size)
|
|||||||
|
|
||||||
const char *util_ald_strdup(const char *s)
|
const char *util_ald_strdup(const char *s)
|
||||||
{
|
{
|
||||||
#ifdef APU_HAS_LDAP_SHARED_CACHE
|
#if APR_HAS_SHARED_MEMORY
|
||||||
if (util_ldap_shm) {
|
if (util_ldap_shm) {
|
||||||
char *buf = apr_shm_malloc(util_ldap_shm, strlen(s)+1);
|
char *buf = apr_shm_malloc(util_ldap_shm, strlen(s)+1);
|
||||||
if (buf) {
|
if (buf) {
|
||||||
|
Reference in New Issue
Block a user