httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike <>
Subject modules + callbacks
Date Fri, 26 Jan 2007 11:25:48 GMT

The Subject here may be completely wrong, so I will describe what I am 
doing. Some years ago I hacked together an authentication module  which 
uses the c-client imap lib. I decided to take a look at porting it to 
2.0 only to realize that the code is complete crap,thus I am looking to 
fix (Disclaimer, I am not a C Programmer).

C-client is implemented such that it obtains data via callback functions 
which must be defined by the caller. One of these  functions is to 
obtain the username and password to auth with. Since this was a callback 
function I did not have any apache context handy to store things in so I 
stuffed the user and password in globals. This is obviously bad so I am 
looking to do it the correct way. My current thought was to create some 
named shared memory segment in the process pool to store this in and 
then maybe store the process pool in a global. Reading/writing the 
user/pass pair to the pool would be controlled by a mutex.

On second thought though this isn't really that much different than if I 
controlled access to the current globals with a mutex, there must be a 
better way? Any advice/pointers appreciated.

Many thanks.


View raw message