Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 16583 invoked by uid 6000); 12 Dec 1997 18:37:52 -0000 Received: (qmail 16568 invoked from network); 12 Dec 1997 18:37:50 -0000 Received: from zab.covalent.net (208.214.56.2) by taz.hyperreal.org with SMTP; 12 Dec 1997 18:37:50 -0000 Received: from gate-isdn.ukweb.com (gate-isdn.ukweb.com [194.152.65.149]) by zab.covalent.net (8.8.7/8.8.7) with SMTP id IAA05003 for ; Fri, 12 Dec 1997 08:48:43 -0600 (CST) (envelope-from paul@eu.c2.net) Received: from ecstasy.localnet [192.168.2.4] by gate-isdn.ukweb.com with smtp (Exim 1.73 #1) id 0xgWOK-0005WI-00; Fri, 12 Dec 1997 14:48:36 +0000 Date: Fri, 12 Dec 1997 14:48:07 +0000 (GMT) From: Paul Sutton To: new-httpd@hyperreal.org Subject: Shared module unloading Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org We load modules dynamically on Win32 - and have the capability to do this on Unix as well - we we completely ingnore changes to the LoadModule lines when we do a restart. So if the user edits (adds/removes) LoadModules and does a restart, they won't get the new modules and Apache doesn't remove the ones they've removed (and if they changed the order of the LoadModules, Apache doesn't see that either). This certainly ought to be logged (say "LoadModule ignored on restart for module XXXX"). But why don't we make LoadModule work on restarts? I've been playing with this on Win32. Here is the plan: - add the loaded modules handle to the "module" struct (so we can unload it) - when it is loaded, store the module's module struct address as a cleanup in the pconf pool - add a cleanup routine for loaded modules: when pconf is cleaned, this gets called and unloads the module, removing it from the linked list of modules So when the parent gets a restart, it cleans the pconf pool which unloads the modules, then run through read_config() again which loads the (possibly different) modules. I *think* this should all work. When we remove modules from the linked list of modules, all the per-dir and per-server vectors will be invalid, but they will be cleaned as part of the pconf cleanup anyway. As long as they aren't ever used once the pool cleanup has started. pconf should only ever be cleaned when a restart is happening (or just before exitting). Can anyone see any problems with doing it this way? An alternative would be to have an explict unload_dynamic_modules function which is called during a restart, which unloads modules from the module linked list. //pcs