You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2002/04/26 23:54:38 UTC
cvs commit: httpd-ldap/ldap-cache util_ldap_cache.c util_ldap_cache.h util_ldap_cache_mgr.c
minfrin 02/04/26 14:54:38
Modified: ldap-cache util_ldap_cache.c util_ldap_cache.h
util_ldap_cache_mgr.c
Log:
Apply a patch to compile cleanly again against changes to the shared memory
implementation in APR.
Submitted by: Eduardo Garcia Lopez <eg...@stream18.com>
Revision Changes Path
1.2 +7 -1 httpd-ldap/ldap-cache/util_ldap_cache.c
Index: util_ldap_cache.c
===================================================================
RCS file: /home/cvs/httpd-ldap/ldap-cache/util_ldap_cache.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- util_ldap_cache.c 16 Oct 2001 21:29:08 -0000 1.1
+++ util_ldap_cache.c 26 Apr 2002 21:54:38 -0000 1.2
@@ -291,11 +291,17 @@
apr_status_t util_ldap_cache_init(apr_pool_t *pool, apr_size_t reqsize)
{
+ apr_anylock_t rmm_lock;
+
apr_status_t result = APR_SUCCESS;
apr_pool_cleanup_register(pool, NULL, util_ldap_cache_module_kill, apr_pool_cleanup_null);
#if APR_HAS_SHARED_MEMORY
- result = apr_shm_init(&util_ldap_shm, reqsize, "/tmp/ldap_cache", pool);
+ result = apr_shm_create(&util_ldap_shm, reqsize, "/tmp/ldap_cache", pool);
+
+ /* This will create a rmm "handler" to get into the shared memory area */
+ apr_rmm_init(&util_ldap_rmm, &rmm_lock,
+ (void *)apr_shm_baseaddr_get(&util_ldap_shm) , reqsize, pool);
#endif
util_ldap_cache = util_ald_create_cache(50,
util_ldap_url_node_hash,
1.3 +3 -1 httpd-ldap/ldap-cache/util_ldap_cache.h
Index: util_ldap_cache.h
===================================================================
RCS file: /home/cvs/httpd-ldap/ldap-cache/util_ldap_cache.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- util_ldap_cache.h 8 Feb 2002 18:29:17 -0000 1.2
+++ util_ldap_cache.h 26 Apr 2002 21:54:38 -0000 1.3
@@ -69,6 +69,7 @@
*/
#include <apr_shm.h>
+#include <apr_rmm.h> /* EDD */
typedef struct util_cache_node_t {
void *payload; /* Pointer to the payload */
@@ -102,7 +103,8 @@
} util_ald_cache_t;
#if APR_HAS_SHARED_MEMORY
-apr_shmem_t *util_ldap_shm;
+apr_shm_t *util_ldap_shm;
+apr_rmm_t *util_ldap_rmm;
#endif
util_ald_cache_t *util_ldap_cache;
apr_thread_rwlock_t *util_ldap_cache_lock;
1.2 +3 -3 httpd-ldap/ldap-cache/util_ldap_cache_mgr.c
Index: util_ldap_cache_mgr.c
===================================================================
RCS file: /home/cvs/httpd-ldap/ldap-cache/util_ldap_cache_mgr.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- util_ldap_cache_mgr.c 16 Oct 2001 21:29:08 -0000 1.1
+++ util_ldap_cache_mgr.c 26 Apr 2002 21:54:38 -0000 1.2
@@ -117,7 +117,7 @@
#if APR_HAS_SHARED_MEMORY
if (util_ldap_shm) {
if (ptr)
- apr_shm_free(util_ldap_shm, (void *)ptr);
+ apr_rmm_free(util_ldap_rmm, apr_rmm_offset_get(util_ldap_rmm, (void *)ptr));
} else {
if (ptr)
free((void *)ptr);
@@ -134,7 +134,7 @@
return NULL;
#if APR_HAS_SHARED_MEMORY
if (util_ldap_shm) {
- return (void *)apr_shm_calloc(util_ldap_shm, size);
+ return (void *)apr_rmm_addr_get(util_ldap_rmm, apr_rmm_calloc(util_ldap_rmm, size));
} else {
return (void *)calloc(sizeof(char), size);
}
@@ -147,7 +147,7 @@
{
#if APR_HAS_SHARED_MEMORY
if (util_ldap_shm) {
- char *buf = apr_shm_malloc(util_ldap_shm, strlen(s)+1);
+ char *buf = (char *)apr_rmm_addr_get(util_ldap_rmm, apr_rmm_calloc(util_ldap_rmm, strlen(s)+1));
if (buf) {
strcpy(buf, s);
return buf;