dovecot-2.2: lib-ssl-iostream: Unload ssl_iostream_openssl plugi...

dovecot at dovecot.org dovecot at dovecot.org
Tue Nov 6 23:50:10 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/7d28b19fe28d
changeset: 15389:7d28b19fe28d
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 06 23:49:57 2012 +0200
description:
lib-ssl-iostream: Unload ssl_iostream_openssl plugin at exit.

diffstat:

 src/lib-ssl-iostream/iostream-ssl.c |  11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (34 lines):

diff -r 6fc2502d6021 -r 7d28b19fe28d src/lib-ssl-iostream/iostream-ssl.c
--- a/src/lib-ssl-iostream/iostream-ssl.c	Tue Nov 06 23:49:24 2012 +0200
+++ b/src/lib-ssl-iostream/iostream-ssl.c	Tue Nov 06 23:49:57 2012 +0200
@@ -4,12 +4,21 @@
 #include "module-dir.h"
 #include "iostream-ssl-private.h"
 
+#include <stdlib.h>
+
 static bool ssl_module_loaded = FALSE;
 #ifdef HAVE_SSL
 static struct module *ssl_module = NULL;
 #endif
 static const struct iostream_ssl_vfuncs *ssl_vfuncs = NULL;
 
+#ifdef HAVE_SSL
+static void ssl_module_unload(void)
+{
+	module_dir_unload(&ssl_module);
+}
+#endif
+
 static int ssl_module_load(void)
 {
 #ifdef HAVE_SSL
@@ -24,6 +33,8 @@
 	ssl_vfuncs = module_get_symbol(ssl_module, "ssl_vfuncs");
 	if (ssl_vfuncs == NULL)
 		i_fatal("%s: ssl_vfuncs symbol not found", plugin_name);
+
+	atexit(ssl_module_unload);
 	ssl_module_loaded = TRUE;
 	return 0;
 #else


More information about the dovecot-cvs mailing list