httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christiaan Lamprecht" <>
Subject Re: Shared memory
Date Fri, 24 Nov 2006 15:58:44 GMT
Thanks for the help everyone!

Mutex's and shm seems to be working fine. I do however need to change
the shared memory at runtime! which is a problem as char* variable1 &
2 is assigned a value (by the client, so the size is unknown at
startup) when a client makes an http request...

typedef struct {
     char* variable1;
     char* variable2;
} ASSLFilter;

apr_shm_create(&assl_shm, sizeof(ASSLFilter) * 20, (const char *)
shmfilename, pconf);

I have tried allocating my own memory for the variables but it seems
to be overwritten (by something) when the next request gets the shared

Also tried using APR pools:
ASSLFilter *assl_filter_list = (ASSLFilter *)apr_shm_baseaddr_get(assl_shm);
assl_filter_list[i].variable1 = apr_pstrdup(r->server->process->pool,
but once again it seems to have disappeared.

Can I make use of shm to extend the memory for each char* in the
struct? e.g. shm_attach

Thanks again

View raw message