cvs commit: apache-1.3/src/modules/standard mod_so.c

1999-03-01 Thread dgaudet
dgaudet 99/03/01 07:37:54

  Modified:src/modules/standard mod_so.c
  Log:
  missing fixer_upper comment
  
  Submitted by: John Bley [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.31  +1 -0  apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- mod_so.c  1999/01/01 22:32:16 1.30
  +++ mod_so.c  1999/03/01 15:37:53 1.31
  @@ -351,6 +351,7 @@
  NULL, /* check auth */
  NULL, /* check access */
  NULL, /* type_checker */
  +   NULL, /* fixer_upper */
  NULL, /* logger */
  NULL, /* header parser */
  NULL, /* child_init */
  
  
  


cvs commit: apache-1.3/src/modules/standard mod_so.c

1999-01-01 Thread rse
rse 99/01/01 14:32:17

  Modified:src  CHANGES
   src/modules/standard mod_so.c
  Log:
  Finally back-out one part of my old patch Roy comitted some time ago.  Roy
  didn't know that I've already withdrawn this part, so don't blame him.  The
  problem is that the additional init rounds breaks backward compatibility and
  not really solve the mod_perl problem. So, it's better to not do it...
  
  Revision  ChangesPath
  1.1190+2 -5  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1189
  retrieving revision 1.1190
  diff -u -r1.1189 -r1.1190
  --- CHANGES   1999/01/01 21:30:18 1.1189
  +++ CHANGES   1999/01/01 22:32:15 1.1190
  @@ -135,11 +135,8 @@
[Ralf S. Engelschall]
   
 *) Added two new core API functions, ap_single_module_configure() and
  - ap_single_module_init(), which are now used by mod_so to correctly
  - initialize a module after loading. This fixes a problem with unusable
  - handlers, for instance mod_perl's perl-script handler was not found
  - when mod_perl was loaded as a DSO, and the same applied to other
  - similar modules. [Ralf S. Engelschall]
  + ap_single_module_init(), which are now used by mod_so to configure a 
module
  + after loading. [Ralf S. Engelschall]
   
 *) PORT: Add defines for USE_FLOCK_SERIALIZED_ACCEPT and
SINGLE_LISTEN_UNSERIALIZED_ACCEPT to NetBSD/OpenBSD section
  
  
  
  1.30  +1 -3  apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- mod_so.c  1999/01/01 20:27:48 1.29
  +++ mod_so.c  1999/01/01 22:32:16 1.30
  @@ -277,11 +277,9 @@
 (void (*)(void*))unload_module, ap_null_cleanup);
   
   /* 
  - * Finally we need to create the configuration for the
  - * module and initialize it
  + * Finally we need to run the configuration process for the module
*/
   ap_single_module_configure(cmd-pool, cmd-server, modp);
  -ap_single_module_init(cmd-pool, cmd-server, modp);
   
   return NULL;
   }
  
  
  


cvs commit: apache-1.3/src/modules/standard mod_so.c

1998-04-14 Thread rse
rse 98/04/14 03:58:24

  Modified:src/helpers find-dbm-lib
   src/modules/standard mod_so.c
  Log:
  Make verbose messages of Configure step more consistent
  
  Revision  ChangesPath
  1.5   +1 -1  apache-1.3/src/helpers/find-dbm-lib
  
  Index: find-dbm-lib
  ===
  RCS file: /export/home/cvs/apache-1.3/src/helpers/find-dbm-lib,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- find-dbm-lib  1998/03/07 21:43:32 1.4
  +++ find-dbm-lib  1998/04/14 10:58:23 1.5
  @@ -37,7 +37,7 @@
;;
esac
if [ X$found_dbm = X1 ]; then
  - echo  + using $DBM_LIB
  + echo  + using $DBM_LIB for DBM support
fi
   fi
   fi
  
  
  
  1.22  +1 -1  apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_so.c  1998/04/13 18:05:16 1.21
  +++ mod_so.c  1998/04/14 10:58:24 1.22
  @@ -140,7 +140,7 @@
   fi
   LIBS=$LIBS $DL_LIB
   if [ X$DL_LIB != X ]; then
  - echo  + using $DL_LIB for dynamic loading (mod_so)
  + echo  + using $DL_LIB for DSO support
   fi
   fi
* ConfigEnd
  
  
  


cvs commit: apache-1.3/src/modules/standard mod_so.c

1998-03-25 Thread rse
rse 98/03/25 01:44:49

  Modified:.STATUS
   src  CHANGES
   src/modules/standard mod_so.c
  Log:
  Make shared object loading work again (now that -DHIDE is the default).
  Distributed modules are loaded with AP_name_module and custom
  modules are now loaded with the fallback strategy via name_module
  (because their name_module is not and canno be hidden by hide.h).
  
  Revision  ChangesPath
  1.205 +2 -0  apache-1.3/STATUS
  
  Index: STATUS
  ===
  RCS file: /export/home/cvs/apache-1.3/STATUS,v
  retrieving revision 1.204
  retrieving revision 1.205
  diff -u -r1.204 -r1.205
  --- STATUS1998/03/23 07:42:09 1.204
  +++ STATUS1998/03/25 09:44:44 1.205
  @@ -102,6 +102,8 @@
   * Ralf's reanim. of undocum. directive: ProxyReceiveBufferSize, PR#1348
   * Ralf's mod_proxy fix to use FTP SIZE response for Content-Length, 
PR#1183
   * Ralf's change to make the shared object compilation command more 
portable
  +* Dean's protect against FD_SETSIZE mismatches
  +* Ralf's fallback stategy because of HIDE for loading shared object 
modules
   
   Available Patches:
   
  
  
  
  1.731 +5 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.730
  retrieving revision 1.731
  diff -u -r1.730 -r1.731
  --- CHANGES   1998/03/25 02:57:19 1.730
  +++ CHANGES   1998/03/25 09:44:46 1.731
  @@ -1,4 +1,9 @@
   Changes with Apache 1.3b6
  + 
  +  *) Finally fix the shared object loading by using a fallback strategy to
  + overcome the HIDE feature problematic without loosing special cases. 
Also
  + a huge comment was added to mod_so.c to make the situation more clear
  + for the future. [Ralf S. Engelschall]
   
 *) Protect against FD_SETSIZE mismatches.  [Dean Gaudet]
   
  
  
  
  1.15  +66 -9 apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- mod_so.c  1998/03/23 15:44:15 1.14
  +++ mod_so.c  1998/03/25 09:44:48 1.15
  @@ -222,6 +222,7 @@
   so_server_conf *sconf;
   moduleinfo *modi;
   moduleinfo *modie;
  +char *modname_hidden;
   int i;
   
   /* 
  @@ -240,7 +241,53 @@
   modi-name = modname;
   
   /*
  - * Actually load the file into the address space 
  + * NOW COMES THE PROBLEMATIC PART:
  + *
  + * Because of the -DHIDE/hide.h feature of Apache 1.3 we have eight
  + * situations from which four doesn't work at all and four are a bit
  + * different because of the AP_ hiding stuff and the fact that this 
symbol
  + * hiding applies only to distributed modules.
  + *
  + * Apache .. means the Apache code itself
  + * S-Module  means a standard module which is distributed with Apache
  + * C-Module  means a custom module which is not distributed with 
Apache
  + * HIDE  means -DHIDE was used when compiling
  + * !HIDE ... means -DHIDE was not used when compiling
  + * xxx . means the symbol name_module of the module structure
  + *
  + *  Resolving| dlopen() dlsym()
  + *   | (implicit)   (explicit)
  + * Situation | core-module core-module
  + * --+---
  + * The compatible variants:  |
  + * Apache+!HIDE  S-Module+!HIDE | succeeds succeeds only w/ xxx
  + * Apache+ HIDE  S-Module+ HIDE | succeeds succeeds only w/ AP_xxx
  + * Apache+!HIDE  C-Module+!HIDE | succeeds succeeds only w/ xxx
  + * Apache+ HIDE  C-Module+ HIDE | succeeds succeeds only w/ xxx  
==
  + * The incompatible variants:|
  + * Apache+!HIDE  S-Module+ HIDE | failswould succeed w/ AP_xxx
  + * Apache+ HIDE  S-Module+!HIDE | failswould succeed w/ xxx
  + * Apache+!HIDE  C-Module+ HIDE | failswould succeed w/ xxx
  + * Apache+ HIDE  C-Module+!HIDE | failswould succeed w/ xxx
  + *
  + * In other words: For the incompatible variants where the Apache core 
was
  + * built with a different setting than the ones the module was compiled
  + * with, we have no chance at all because the implicit resolving of
  + * Apache's core symbols in dlopen() already fails for the module 
(because
  + * for instance the module needs palloc while Apache exports AP_palloc).
  + *
  + * So, only for the compatible variants we have a chance. And here we
  + * succeed by always trying to resolve 

cvs commit: apache-1.3/src/modules/standard mod_so.c

1998-03-25 Thread rse
rse 98/03/25 04:57:43

  Modified:src/modules/standard mod_so.c
  Log:
  Another hint where to find information about building shared
  objects for the various platforms.
  
  Revision  ChangesPath
  1.16  +4 -0  apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- mod_so.c  1998/03/25 09:44:48 1.15
  +++ mod_so.c  1998/03/25 12:57:42 1.16
  @@ -114,6 +114,10 @@
* and which compiler and linker flags Perl 5 uses to create the shared 
object
* files.
*
  + * Another location where you can find useful hints is the `ltconfig' script
  + * of the GNU libtool 1.2 package. Search for your platform name inside the
  + * various case constructs.
  + *
*/
   
   
  
  
  


cvs commit: apache-1.3/src/modules/standard mod_so.c

1998-03-23 Thread rse
rse 98/03/23 07:44:16

  Modified:src/modules/standard mod_so.c
  Log:
  if apache+HIDE  module+!HIDE then
  no chance at all, because dlopen() cannot implicitly
  resolve apache's XXX symbols for module because they
  are named AP_XXX
  else if apache+!HIDE  module+HIDE then
  no chance at all, because dlopen() cannot implicitly
  resolve apache's AP_XXX symbols for module because they
  are named XXX
  else if apache+HIDE  module+HIDE then
  we have to prefix the resolved module symbol with AP_
  (THIS PATCH!)
  else if apache+!HIDE  module+!HIDE then
  we have to just resolve the symbol as is
  (AS ALREADY DONE IN THE PAST)
  
  Revision  ChangesPath
  1.14  +4 -0  apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- mod_so.c  1998/03/17 19:47:54 1.13
  +++ mod_so.c  1998/03/23 15:44:15 1.14
  @@ -252,6 +252,10 @@
   aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL,
loaded module %s, modname);
   
  +#ifdef HIDE
  +modname = pstrcat(cmd-pool, AP_, modname, NULL);
  +#endif
  +
   #ifdef NEED_UNDERSCORE_SYM
   modname = pstrcat(cmd-pool, _, modname, NULL);
   #endif
  
  
  


cvs commit: apache-1.3/src/modules/standard mod_so.c

1998-03-13 Thread Ralf S. Engelschall
rse 98/03/13 05:28:21

  Modified:src/include hide.h
   src/main alloc.c http_core.c http_main.c http_config.c
   src/modules/standard mod_so.c
  Log:
  Shrink list of global symbols by making more stuff static
  which currently is global without need.
  
  Revision  ChangesPath
  1.9   +0 -8  apache-1.3/src/include/hide.h
  
  Index: hide.h
  ===
  RCS file: /export/home/cvs/apache-1.3/src/include/hide.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- hide.h1998/03/13 12:06:58 1.8
  +++ hide.h1998/03/13 13:28:13 1.9
  @@ -109,22 +109,17 @@
   #define action_module  AP_action_module
   #define agent_log_module   AP_agent_log_module
   #define alias_module   AP_alias_module
  -#define alloc_mutexAP_alloc_mutex
   #define anon_auth_module   AP_anon_auth_module
   #define asis_moduleAP_asis_module
   #define auth_moduleAP_auth_module
   #define autoindex_module   AP_autoindex_module
  -#define block_freelist AP_block_freelist
   #define cern_meta_module   AP_cern_meta_module
   #define cgi_module AP_cgi_module
   #define config_log_module  AP_config_log_module
  -#define core_cmds  AP_core_cmds
  -#define core_handlers  AP_core_handlers
   #define core_moduleAP_core_module
   #define day_snames AP_day_snames
   #define db_auth_module AP_db_auth_module
   #define dbm_auth_moduleAP_dbm_auth_module
  -#define default_parms  AP_default_parms
   #define digest_module  AP_digest_module
   #define dir_module AP_dir_module
   #define dummy_mutexAP_dummy_mutex
  @@ -139,7 +134,6 @@
   #define mime_moduleAP_mime_module
   #define month_snames   AP_month_snames
   #define negotiation_module AP_negotiation_module
  -#define one_processAP_one_process
   #define prelinked_modules  AP_prelinked_modules
   #define preloaded_modules  AP_preloaded_modules
   #define proxy_module   AP_proxy_module
  @@ -148,9 +142,7 @@
   #define rfc1413_timeoutAP_rfc1413_timeout
   #define scoreboard_image   AP_scoreboard_image
   #define setenvif_moduleAP_setenvif_module
  -#define so_cmdsAP_so_cmds
   #define so_module  AP_so_module
  -#define spawn_mutexAP_spawn_mutex
   #define speling_module AP_speling_module
   #define status_module  AP_status_module
   #define suexec_enabled AP_suexec_enabled
  
  
  
  1.76  +3 -3  apache-1.3/src/main/alloc.c
  
  Index: alloc.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/alloc.c,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- alloc.c   1998/03/09 22:42:58 1.75
  +++ alloc.c   1998/03/13 13:28:15 1.76
  @@ -159,9 +159,9 @@
   } h;
   };
   
  -union block_hdr *block_freelist = NULL;
  -mutex *alloc_mutex = NULL;
  -mutex *spawn_mutex = NULL;
  +static union block_hdr *block_freelist = NULL;
  +static mutex *alloc_mutex = NULL;
  +static mutex *spawn_mutex = NULL;
   #ifdef POOL_DEBUG
   static char *known_stack_point;
   static int stack_direction;
  
  
  
  1.166 +2 -2  apache-1.3/src/main/http_core.c
  
  Index: http_core.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_core.c,v
  retrieving revision 1.165
  retrieving revision 1.166
  diff -u -r1.165 -r1.166
  --- http_core.c   1998/03/02 06:51:07 1.165
  +++ http_core.c   1998/03/13 13:28:16 1.166
  @@ -1815,7 +1815,7 @@
* The AllowOverride of Fileinfo allows webmasters to turn it off
*/
   
  -command_rec core_cmds[] = {
  +static command_rec core_cmds[] = {
   
   /* Old access config file commands */
   
  @@ -2144,7 +2144,7 @@
   return OK;
   }
   
  -handler_rec core_handlers[] = {
  +static handler_rec core_handlers[] = {
   { */*, default_handler },
   { NULL }
   };
  
  
  
  1.301 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.300
  retrieving revision 1.301
  diff -u -r1.300 -r1.301
  --- http_main.c   1998/03/08 04:25:57 1.300
  +++ http_main.c   1998/03/13 13:28:17 1.301
  @@ -284,7 +284,7 @@
* Continue through and 

cvs commit: apache-1.3/src/modules/standard mod_so.c

1998-03-10 Thread Ralf S. Engelschall
rse 98/03/10 00:52:59

  Modified:.STATUS
   src  CHANGES
   src/modules/standard mod_so.c
  Log:
  Enhance Shared Object Loading (II)
  --
  
  mod_so now keeps track itself of which modules are actually loaded and which
  are not by remembering both the module pointer and the module name. This fixes
  two problems:
  
  1. Because our server configuration is read twice the modules
 were loaded twice which is both not needed and leads to confusion later on
 unload because the OS-internal load counter increases. Then on unload the
 module pointer was removed from the Apache core structure on the first
 unloads but (because of the load counter) the modules were removed later.
 Although this worked, it was very ugly. The only consequence is that we now
 keep track of loaded modules ourself and don't rely on the dynamic loader
 of the platform. This now also avoids multiply tries to unload an already
 unloaded module and thus removes harmless but irritating error_log entries
 ``[error] Cannot remove module mod_setenvif.c: not found in module list''.
 as shown below.
  
  2. Because we now keep track of the module names we used on loading we now can
 give correct corresponding log messages even on unloading.
  
  To illustrate the change, here is the old error_log:
  (the first unloads correspond to the first loads which
   are printed on stderr unless mod_log_config is present)
  
  [debug] mod_so.c(163): unloaded module mod_setenvif.c
  [debug] mod_so.c(163): unloaded module mod_access.c
  [debug] mod_so.c(163): unloaded module mod_userdir.c
  [debug] mod_so.c(163): unloaded module mod_dir.c
  [debug] mod_so.c(163): unloaded module mod_autoindex.c
  [debug] mod_so.c(163): unloaded module mod_negotiation.c
  [debug] mod_so.c(163): unloaded module mod_log_config.c
  [error] Cannot remove module mod_setenvif.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_setenvif.c
  [error] Cannot remove module mod_access.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_access.c
  [error] Cannot remove module mod_userdir.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_userdir.c
  [error] Cannot remove module mod_dir.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_dir.c
  [error] Cannot remove module mod_autoindex.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_autoindex.c
  [error] Cannot remove module mod_negotiation.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_negotiation.c
  [error] Cannot remove module mod_log_config.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_log_config.c
  [error] Cannot remove module mod_setenvif.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_setenvif.c
  [error] Cannot remove module mod_access.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_access.c
  [error] Cannot remove module mod_userdir.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_userdir.c
  [error] Cannot remove module mod_dir.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_dir.c
  [error] Cannot remove module mod_autoindex.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_autoindex.c
  [error] Cannot remove module mod_negotiation.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_negotiation.c
  [error] Cannot remove module mod_log_config.c: not found in module list
  [debug] mod_so.c(163): unloaded module mod_log_config.c
  [debug] mod_so.c(211): loaded module config_log_module
  [debug] mod_so.c(211): loaded module negotiation_module
  [debug] mod_so.c(211): loaded module autoindex_module
  [debug] mod_so.c(211): loaded module dir_module
  [debug] mod_so.c(211): loaded module userdir_module
  [debug] mod_so.c(211): loaded module access_module
  [debug] mod_so.c(211): loaded module setenvif_module
  [debug] mod_so.c(211): loaded module config_log_module
  [debug] mod_so.c(211): loaded module negotiation_module
  [debug] mod_so.c(211): loaded module autoindex_module
  [debug] mod_so.c(211): loaded module dir_module
  [debug] mod_so.c(211): loaded module userdir_module
  [debug] mod_so.c(211): loaded module access_module
  [debug] mod_so.c(211): loaded module setenvif_module
  [debug] mod_so.c(211): loaded module config_log_module
  [debug] mod_so.c(211): loaded module negotiation_module
  [debug] mod_so.c(211): loaded module autoindex_module
  [debug] mod_so.c(211): loaded module dir_module
  [debug] mod_so.c(211): loaded module userdir_module
  [debug] mod_so.c(211): loaded module access_module
  [debug] mod_so.c(211): loaded module setenvif_module
  [notice] Apache/1.3b6-dev configured -- resuming normal operations
  [notice] httpd: caught SIGTERM, shutting down
  [debug] mod_so.c(163): unloaded 

cvs commit: apache-1.3/src/modules/standard mod_so.c

1998-03-09 Thread Ralf S. Engelschall
rse 98/03/09 03:35:42

  Modified:src/modules/standard mod_so.c
  Log:
  Cosmetics and completion of module structure
  
  Revision  ChangesPath
  1.6   +5 -2  apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- mod_so.c  1998/02/24 10:30:54 1.5
  +++ mod_so.c  1998/03/09 11:35:42 1.6
  @@ -222,7 +222,7 @@

   modp-dynamic_load_handle = modhandle;
   
  -add_module (modp);
  +add_module(modp);
   
   /* Register a cleanup in the config pool (normally pconf). When
* we do a restart (or shutdown) this cleanup will cause the
  @@ -307,5 +307,8 @@
  NULL, /* check access */
  NULL, /* type_checker */
  NULL, /* logger */
  -   NULL  /* header parser */
  +   NULL, /* header parser */
  +   NULL, /* child_init */
  +   NULL, /* child_exit */
  +   NULL  /* post read-request */
   };
  
  
  


cvs commit: apache-1.3/src/modules/standard mod_so.c

1998-02-06 Thread pcs
pcs 98/02/06 10:16:46

  Modified:src/modules/standard mod_so.c
  Log:
  Make LoadModule and LoadFile work correctly across restarts (i.e.
  by unloading the loaded modules/files, then reloading when the config
  file is read again).
  
  Add longer commentary about how to use the module (which could become
  a part of the documentation when this module become non-experimental).
  
  Properly report errors during LoadFile.
  
  Revision  ChangesPath
  1.3   +125 -36   apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mod_so.c  1998/02/04 10:22:18 1.2
  +++ mod_so.c  1998/02/06 18:16:45 1.3
  @@ -1,5 +1,5 @@
   /* 
  - * Copyright (c) 1995-1997 The Apache Group.  All rights reserved.
  + * Copyright (c) 1995-1998 The Apache Group.  All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
  @@ -51,7 +51,58 @@
*
*/
   
  -/* How to create .so files on various platforms:
  +/* 
  + * This module is used to load Apache modules at runtime. This means
  + * that the server functionality can be extended without recompiling
  + * and even without taking the server down at all!
  + *
  + * To use, you'll first need to build your module as a shared library, then
  + * update your configuration (httpd.conf) to get the Apache core to
  + * load the module at start-up.
  + *
  + * The easiest way to build a module as a shared library is to use the
  + * SharedModule command in the Configuration file, instead of AddModule.
  + * You should also change the file extension from .o to .so. So, for example,
  + * to build the status module as a shared library edit Configuration
  + * and change
  + *   AddModulemodules/standard/mod_status.o
  + * to
  + *   SharedModule modules/standard/mod_status.so
  + *
  + * Run Configure and make. Now Apache's httpd will _not_ include
  + * mod_status. Instead a shared library called mod_status.so will be
  + * build, in the modules/standard directory. You can build any or all
  + * modules as shared libraries like this.
  + *
  + * To use the shared module, move the .so file(s) into an appropriate
  + * directory. You might like to create a directory called modules under
  + * you server root for this (e.g. /usr/local/httpd/modules). 
  + *
  + * Then edit your conf/httpd.conf file, and add LoadModule lines. For
  + * example
  + *   LoadModule  status_module   modules/mod_status.so
  + *
  + * The first argument is the module's structure name (look at the
  + * end of the module source to find this). The second option is
  + * the path to the module file, relative to the server root.
  + * Put these directives right at the top of your httpd.conf file.
  + *
  + * Now you can start Apache. A message will be logged at debug level
  + * to your error_log to confirm that the module(s) are loaded (use
  + * LogLevel debug directive to get these log messages).
  + *
  + * If you edit the LoadModule directives while the server is live you
  + * can get Apache to re-load the modules by sending it a HUP or USR1
  + * signal as normal. You can use this to dynamically change the 
  + * capability of your server without bringing it down.
  + *
  + * Apache's Configure currently only creates shared modules on
  + * Linux 2 and FreeBSD systems. 
  + */
  +
  +/* More details about shared libraries:
  + *
  + * How to create .so files on various platforms:
   
  FreeBSD:
 gcc -fpic to compile
  @@ -120,36 +171,63 @@
   #define RTLD_LAZY 1
   #endif
   
  -/*
  - * The hard part of implementing LoadModule is deciding what to do about
  - * rereading the config files.  This proof-of-concept implementation takes 
the 
  - * cheap way out:  we only actually load the modules the first time through.
  - */
  -
  -static int been_there_done_that = 0; /* Loaded the modules yet? */
   static int have_symbol_table = 0;
   
   #ifndef NO_DLOPEN
  +
  +/* This is the cleanup for a loaded DLL. It unloads the module.
  + * This is called as a cleanup function.
  + */
  +
  +void unload_module(module *modp)
  +{
  +char mod_name[50];   /* Um, no pool, so make this static */
  +
  +/* Take a copy of the module name so we can report that it has been
  + * unloaded (since modp itself will have been unloaded). */
  +strncpy(mod_name, modp-name, 49);
  +mod_name[49] = '\0';
  +
  +remove_module(modp);
  +
  +/* The Linux manpage doesn't give any way to check the success of
  + * dlclose() */
  +dlclose(modp-dynamic_load_handle);
  +
  +aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL,
  + 

cvs commit: apache-1.3/src/modules/standard mod_so.c

1998-02-04 Thread pcs
pcs 98/02/04 02:22:18

  Modified:src/modules/standard mod_so.c
  Log:
  Now tries to find the appropriate library for dynamic loading during
  Configure. Looks for -ldl if dlopen() isn't already available.
  
  Revision  ChangesPath
  1.2   +22 -0 apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mod_so.c  1998/02/03 10:41:35 1.1
  +++ mod_so.c  1998/02/04 10:22:18 1.2
  @@ -62,6 +62,28 @@
   
   */
   
  +/*
  + * Module definition information
  + *
  + * MODULE-DEFINITION-START
  + * Name: so_module
  + * ConfigStart
  +if ./helpers/TestCompile func dlopen; then
  + :
  +else
  +DL_LIB=
  +if ./helpers/TestCompile lib dl; then
  + DL_LIB=-ldl
  +fi
  +LIBS=$LIBS $DL_LIB
  +if [ X$DL_LIB != X ]; then
  + echo  + using $DL_LIB for dynamic loading (mod_so)
  +fi
  +fi
  + * ConfigEnd
  + * MODULE-DEFINITION-END
  + */
  +
   #include httpd.h
   #include http_config.h
   #include http_log.h