> You need to call dkim_init() once before your program becomes
> multi-threaded, and dkim_close() once when the application is shutting
> down. Then, in each thread, you call dkim_sign() or dkim_verify() to set
> up one of those operations, and dkim_free() to terminate them.
> Let me know if that works.
>
Wow... now that's woking perfectly!
I call dkim_init on module load and dkim_close on module unload. That's
before the program become threaded. To do that now I use contructor and
destructor:
DKIM_LIB *dkim_libh = NULL;
void __attribute__ ((constructor)) module_init() { // module constructor
// setup dkim library
dkim_libh = dkim_init(NULL, NULL);
}
void __attribute__ ((destructor)) module_fini() { // module destructor
// cleanup things
dkim_close(dkim_libh);
}
Now it is much more clean! Thank you!!!
Dino.
--
Dino Ciuffetti
Linux System Administrator and Architect
TuxWeb S.r.l. - http://www.tuxweb.it/
Received on Sat May 01 2010 - 00:47:44 PST