load_module call in vcl

Izak Burger izak at upfrontsystems.co.za
Thu Jan 13 09:03:18 CET 2011


On 12/01/2011 23:58, Izak Burger wrote:
> I've been studying the embedded C code used by the geoip plugin and
> noticed how dlopen is used to load this functionality by declaring a
> load_module procedure. What I cannot seem to figure out is where and how
> this is called (grep is not my friend tonight), so at present it seems
> almost like magic (or more likely, a level of indirection I'm missing).
> Can anyone enlighten me?

After 7/8ths of a good night's sleep I realise this is an insanely 
stupid question, or at least one for which RTFM would have been an 
justifiable answer. The answer is in the dlopen man page. It would seen 
dlopen calls anything with the __attribute__((constructor)) attribute to 
initialise the module, and that there is a destructor as well. This is 
common for me: I figure things out just as I send an email to the list. 
Perhaps this helps someone else as well some day.

regards,
Izak




More information about the varnish-dev mailing list