You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by bn...@apache.org on 2002/03/14 17:48:19 UTC

cvs commit: httpd-2.0/os/netware Apache.def

bnicholes    02/03/14 08:48:19

  Modified:    server/mpm/netware mpm_netware.c
               os/netware Apache.def
  Log:
  Added code to extract the current address space name so that each
  instance of Apache can be identified by the address space that it is running in
  
  Revision  Changes    Path
  1.36      +16 -3     httpd-2.0/server/mpm/netware/mpm_netware.c
  
  Index: mpm_netware.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/netware/mpm_netware.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- mpm_netware.c	13 Mar 2002 20:48:03 -0000	1.35
  +++ mpm_netware.c	14 Mar 2002 16:48:19 -0000	1.36
  @@ -172,6 +172,7 @@
   static apr_pool_t *pmain;		/* Pool for httpd child stuff */
   
   static pid_t ap_my_pid;	/* it seems silly to call getpid all the time */
  +static char *ap_my_addrspace = NULL;
   
   static int die_now = 0;
   
  @@ -806,7 +807,10 @@
       ap_listen_rec *lr;
       module **m;
   
  -    printf("%s ID: %d\n", ap_get_server_version(), getpid());
  +    printf("%s\n", ap_get_server_version());
  +    if (ap_my_addrspace && (ap_my_addrspace[0] != 'O') && (ap_my_addrspace[1] != 'S'))
  +        printf("   Running in address space %s\n", ap_my_addrspace);
  +
   
       /* Display listening ports */
       printf("   Listening on port(s):");
  @@ -957,14 +961,24 @@
       return 0;
   }
   
  +/* GetCurrentAddressSpace - this should be replaced with the correct header file when available! */
  +struct _BogusAddressSpace { int a; int b; int c; char name[]; };
  +typedef struct _BogusAddressSpace BogusAddressSpace;
  +extern BogusAddressSpace* GetCurrentAddressSpace(void);
  +/* GetCurrentAddressSpace */
  +
   static int netware_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
   {
       int debug;
  +    BogusAddressSpace *addrspace = NULL;
   
       debug = ap_exists_config_define("DEBUG");
   
       is_graceful = 0;
       ap_my_pid = getpid();
  +    addrspace = GetCurrentAddressSpace();
  +    if (addrspace)
  +        ap_my_addrspace = apr_pstrdup (p, addrspace->name);
   
       ap_listen_pre_config();
       ap_threads_to_start = DEFAULT_START_THREADS;
  @@ -1046,7 +1060,6 @@
       }
   }
   
  -
   static int CommandLineInterpreter(scr_t screenID, const char *commandLine)
   {
       char *szCommand = "APACHE2 ";
  @@ -1077,7 +1090,7 @@
   
           /* If we got an instance id but it doesn't match this 
               instance of the nlm, pass it on. */
  -        if (pID && (atoi(&pID[2]) != getpid()))
  +        if (pID && ap_my_addrspace && strnicmp(&pID[2], ap_my_addrspace, strlen(ap_my_addrspace)))
               return NOTMYCOMMAND;
   
           /* If we have determined that this command belongs to this
  
  
  
  1.4       +1 -0      httpd-2.0/os/netware/Apache.def
  
  Index: Apache.def
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/os/netware/Apache.def,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Apache.def	18 Jan 2002 23:30:14 -0000	1.3
  +++ Apache.def	14 Mar 2002 16:48:19 -0000	1.4
  @@ -2,3 +2,4 @@
   MODULE  LIBC.NLM
   MODULE  WS2_32.NLM
   EXPORT  @HTTPD.IMP
  +IMPORT	GetCurrentAddressSpace