Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 0edc1ab5fa5058149211d8fea160d752 > files > 9

proftpd-1.3.2-0.4mdv2009.0.src.rpm

--- mod_autohost/mod_autohost.c	2005-04-15 01:20:24.000000000 -0400
+++ mod_autohost/mod_autohost.c.oden	2006-10-26 20:43:16.000000000 -0400
@@ -250,6 +250,15 @@
   return;
 }
 
+#if defined(PR_SHARED_MODULE)
+static void autohost_mod_unload_ev(const void *event_data, void *user_data) {
+  if (strcmp("mod_autohost.c", (const char *) event_data) == 0) {
+    /* Unregister ourselves from all events. */
+    pr_event_unregister(&autohost_module, NULL, NULL);
+  }
+}
+#endif /* PR_SHARED_MODULE */
+
 static void autohost_postparse_ev(const void *event_data, void *user_data) {
   config_rec *c = find_config(main_server->conf, CONF_PARAM, "AutoHostEngine",
     FALSE);
@@ -316,6 +325,9 @@
  */
 
 static int autohost_init(void) {
+#if defined(PR_SHARED_MODULE)
+    pr_event_register(&autohost_module, "core.module-unload", autohost_mod_unload_ev, NULL);
+#endif /* PR_SHARED_MODULE */
   pr_event_register(&autohost_module, "core.postparse", autohost_postparse_ev,
     NULL);