[dovecot-cvs] dovecot/src/imap Makefile.am,1.19,1.20 main.c,1.32,1.33

cras at procontrol.fi cras at procontrol.fi
Wed May 14 22:23:07 EEST 2003


Update of /home/cvs/dovecot/src/imap
In directory danu:/tmp/cvs-serv27511/src/imap

Modified Files:
	Makefile.am main.c 
Log Message:
Added support for dynamically loadable imap/pop3 modules.



Index: Makefile.am
===================================================================
RCS file: /home/cvs/dovecot/src/imap/Makefile.am,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- Makefile.am	12 May 2003 06:15:25 -0000	1.19
+++ Makefile.am	14 May 2003 18:23:04 -0000	1.20
@@ -8,7 +8,7 @@
 	-I$(top_srcdir)/src/lib-imap \
 	-I$(top_srcdir)/src/lib-storage
 
-imap_LDADD = \
+libs = \
 	../lib-storage/register/libstorage-register.a \
 	$(STORAGE_LIBS) \
 	../lib-storage/libstorage.a \
@@ -16,10 +16,14 @@
 	../lib-imap/libimap.a \
 	../lib-mail/libmail.a \
 	../lib-charset/libcharset.a \
-	../lib/liblib.a \
-	$(LIBICONV)
+	../lib/liblib.a
 
-imap_DEPENDENCIES = $(imap_LDADD)
+imap_LDADD = \
+	$(libs) \
+	$(LIBICONV) \
+	$(MODULE_LIBS)
+
+imap_DEPENDENCIES = $(libs)
 
 cmds = \
 	cmd-append.c \

Index: main.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/main.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- main.c	14 May 2003 17:23:11 -0000	1.32
+++ main.c	14 May 2003 18:23:04 -0000	1.33
@@ -7,6 +7,7 @@
 #include "restrict-access.h"
 #include "fd-close-on-exec.h"
 #include "process-title.h"
+#include "module-dir.h"
 #include "mail-storage.h"
 #include "commands.h"
 
@@ -20,6 +21,7 @@
 struct ioloop *ioloop;
 unsigned int max_custom_flag_length, mailbox_check_interval;
 
+static struct module *modules;
 static char log_prefix[128]; /* syslog() needs this to be permanent */
 
 static void sig_quit(int signo __attr_unused__)
@@ -88,8 +90,11 @@
 
         mail_storage_init();
 	mail_storage_register_all();
-	commands_init();
 	clients_init();
+	commands_init();
+
+	modules = getenv("MODULE_DIR") == NULL ? NULL :
+		module_dir_load(getenv("MODULE_DIR"));
 
 	mail = getenv("MAIL");
 	if (mail == NULL) {
@@ -144,8 +149,10 @@
 	if (lib_signal_kill != 0 && lib_signal_kill != 2)
 		i_warning("Killed with signal %d", lib_signal_kill);
 
-	clients_deinit();
+	module_dir_unload(modules);
+
 	commands_deinit();
+	clients_deinit();
         mail_storage_deinit();
 
 	closelog();



More information about the dovecot-cvs mailing list