httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apache-1.3/src CHANGES
Date Fri, 22 Jun 2001 12:43:55 GMT
trawick     01/06/22 05:43:55

  Modified:    src/include ap_config.h
               src/main http_config.c http_main.c http_protocol.c
               src/os/tpf os.c os.h
               src      CHANGES
  Log:
  These patches affect only TPF.
  They are driven by changes to the TPF operating system:
       updates in shutdown processing to accommodate new code in TPF's
  Internet Daemon
       updates to allow non-blocking file descriptors on TPF now that our
  select() supports non-socket file descriptors
       changes to os.c to take advantage of TPF's newly enhanced version
  of fork and exec
       moving TPF-specific printf's for the -V option from http_main.c to
  os.c
  
  Submitted by:	David McCreedy <McCreedy@us.ibm.com>
  Reviewed by:	Jeff Trawick
  
  Revision  Changes    Path
  1.309     +1 -0      apache-1.3/src/include/ap_config.h
  
  Index: ap_config.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/include/ap_config.h,v
  retrieving revision 1.308
  retrieving revision 1.309
  diff -u -r1.308 -r1.309
  --- ap_config.h	2001/06/12 08:38:59	1.308
  +++ ap_config.h	2001/06/22 12:43:53	1.309
  @@ -914,6 +914,7 @@
   #define S_IREAD S_IRUSR
   #define S_IWRITE S_IWUSR
   #define S_IEXEC S_IXUSR
  +#include <unistd.h>
   #define crypt(buf,salt) ((char *)buf)
   #undef  offsetof
   #define offsetof(s_type,field) ((size_t)&(((s_type*)0)->field))
  
  
  
  1.160     +1 -1      apache-1.3/src/main/http_config.c
  
  Index: http_config.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_config.c,v
  retrieving revision 1.159
  retrieving revision 1.160
  diff -u -r1.159 -r1.160
  --- http_config.c	2001/01/24 02:11:09	1.159
  +++ http_config.c	2001/06/22 12:43:54	1.160
  @@ -1745,7 +1745,7 @@
       for (n = 0; ap_loaded_modules[n]; ++n) {
   	printf("  %s\n", ap_loaded_modules[n]->name);
       }
  -#if !defined(WIN32) && !defined(NETWARE)
  +#if !defined(WIN32) && !defined(NETWARE) && !defined(TPF)
       printf("suexec: %s\n",
   	   ap_suexec_enabled
   	       ? "enabled; valid wrapper " SUEXEC_BIN
  
  
  
  1.542     +14 -11    apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.541
  retrieving revision 1.542
  diff -u -r1.541 -r1.542
  --- http_main.c	2001/06/12 08:38:56	1.541
  +++ http_main.c	2001/06/22 12:43:54	1.542
  @@ -3200,7 +3200,7 @@
   {
       int result = 0;
   
  -#if !defined(WIN32) && !defined(NETWARE)
  +#if !defined(WIN32) && !defined(NETWARE) && !defined(TPF)
       struct stat wrapper;
   
       if ((stat(SUEXEC_BIN, &wrapper)) != 0) {
  @@ -3665,6 +3665,9 @@
       printf("Server's Module Magic Number: %u:%u\n",
   	   MODULE_MAGIC_NUMBER_MAJOR, MODULE_MAGIC_NUMBER_MINOR);
       printf("Server compiled with....\n");
  +#ifdef TPF
  +    show_os_specific_compile_settings();
  +#endif
   #ifdef BIG_SECURITY_HOLE
       printf(" -D BIG_SECURITY_HOLE\n");
   #endif
  @@ -3683,12 +3686,6 @@
   #ifdef USE_SHMGET_SCOREBOARD
       printf(" -D USE_SHMGET_SCOREBOARD\n");
   #endif
  -#ifdef USE_TPF_SCOREBOARD
  -    printf(" -D USE_TPF_SCOREBOARD\n");
  -#endif
  -#ifdef NO_SAWNC
  -    printf(" -D NO_SAWNC\n");
  -#endif
   #ifdef USE_OS2_SCOREBOARD
       printf(" -D USE_OS2_SCOREBOARD\n");
   #endif
  @@ -3754,7 +3751,7 @@
   #ifdef HTTPD_ROOT
       printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n");
   #endif
  -#ifdef SUEXEC_BIN
  +#if defined(SUEXEC_BIN) && !defined(TPF)
       printf(" -D SUEXEC_BIN=\"" SUEXEC_BIN "\"\n");
   #endif
   #if defined(SHARED_CORE) && defined(SHARED_CORE_DIR)
  @@ -4795,9 +4792,15 @@
   
   	    perform_idle_server_maintenance();
   #ifdef TPF
  -        shutdown_pending = os_check_server(tpf_server_name);
  -        ap_check_signals();
  -        sleep(1);
  +            ap_check_signals();
  +            if (!shutdown_pending) {
  +                if (os_check_server(tpf_server_name)) {
  +                    shutdown_pending++;
  +                } else {
  +                    sleep(1);
  +                    ap_check_signals();
  +                }
  +            }
   #endif /*TPF */
   	}
   
  
  
  
  1.301     +10 -1     apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.300
  retrieving revision 1.301
  diff -u -r1.300 -r1.301
  --- http_protocol.c	2001/03/09 10:10:26	1.300
  +++ http_protocol.c	2001/06/22 12:43:54	1.301
  @@ -2269,13 +2269,16 @@
       long total_bytes_sent = 0;
       register int n, w, o, len, fd;
       fd_set fds;
  +#ifdef TPF
  +    struct timeval tv;
  +#endif 
   
       if (length == 0)
           return 0;
   
       /* Make fb unbuffered and non-blocking */
       ap_bsetflag(fb, B_RD, 0);
  -#ifndef TPF    
  +#ifndef TPF_NO_NONSOCKET_SELECT
       ap_bnonblock(fb, B_RD);
   #endif
       fd = ap_bfileno(fb, B_RD);
  @@ -2334,7 +2337,13 @@
                * we don't care what select says, we might as well loop back
                * around and try another read
                */
  +#ifdef TPF_HAVE_NONSOCKET_SELECT
  +            tv.tv_sec =  1;
  +            tv.tv_usec = 0;
  +            ap_select(fd + 1, &fds, NULL, NULL, &tv);
  +#else
               ap_select(fd + 1, &fds, NULL, NULL, NULL);
  +#endif  
   #ifdef NDELAY_PIPE_RETURNS_ZERO
   	    afterselect = 1;
   #endif
  
  
  
  1.12      +71 -2     apache-1.3/src/os/tpf/os.c
  
  Index: os.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/os/tpf/os.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- os.c	2001/03/09 10:10:51	1.11
  +++ os.c	2001/06/22 12:43:55	1.12
  @@ -103,6 +103,7 @@
       ap_check_signals();
       if ((no_reads + no_writes + no_excepts == 0) &&
           (tv) && (tv->tv_sec + tv->tv_usec != 0)) {
  +#ifdef TPF_HAVE_SAWNC
           /* TPF's select immediately returns if the sum of
              no_reads, no_writes, and no_excepts is zero.
              This means that the select calls in http_main.c
  @@ -110,7 +111,6 @@
              The following code makes TPF's select work a little closer
              to everyone else's select:
           */
  -#ifndef NO_SAWNC
           struct ev0bk evnblock;
   
           timeout = tv->tv_sec;
  @@ -202,7 +202,15 @@
      TPF_FORK_CHILD           *cld = (TPF_FORK_CHILD *) data;
      array_header             *env_arr = ap_table_elts ((array_header *) cld->subprocess_env);
      table_entry              *elts = (table_entry *) env_arr->elts;
  +#ifdef TPF_FORK_EXTENDED
  +   char                     *args[2];
  +   char                     **envp = NULL;
  +   pool                     *subpool = NULL;
   
  +#include "util_script.h"
  +
  +#endif /* TPF_FORK_EXTENDED */ 
  +
      if (func) {
         if (result=func(data, NULL)) {
             return 0;                    /* error from child function */
  @@ -233,12 +241,22 @@
         dup2(err_fds[1], STDERR_FILENO);
      }
   
  +/* set up environment variables for the tpf_fork */
      if (cld->subprocess_env) {
  +#ifdef TPF_FORK_EXTENDED
  +   /* with extended tpf_fork( ) we pass the pointer to a list of pointers */
  +   /* that point to "key=value" strings for each env variable             */ 
  +      subpool = ap_make_sub_pool(p);
  +      envp = ap_create_environment(subpool, cld->subprocess_env);
  +#else
  +   /* without extended tpf_fork( ) we setenv( ) each env variable */
  +   /* so the child inherits them                                  */
         for (i = 0; i < env_arr->nelts; ++i) {
              if (!elts[i].key)
                  continue;
              setenv (elts[i].key, elts[i].val, 1);
          }
  +#endif /* TPF_FORK_EXTENDED */
      }
   
      fork_input.program = (const char*) cld->filename;
  @@ -247,9 +265,16 @@
      fork_input.ebw_data_length = 0;
      fork_input.ebw_data = NULL;
      fork_input.parm_data = NULL;
  -
   
  +#ifdef TPF_FORK_EXTENDED
  +   args[0] = cld->filename;
  +   args[1] = NULL;
  +   if ((pid = tpf_fork(&fork_input,
  +                       (const char **)args,
  +                       (const char **)envp)) < 0) {
  +#else
      if ((pid = tpf_fork(&fork_input)) < 0) {
  +#endif /* TPF_FORK_EXTENDED */
          save_errno = errno;
          if (pipe_out) {
              close(out_fds[0]);
  @@ -264,6 +289,11 @@
          pid = 0;
      }
   
  +#ifdef TPF_FORK_EXTENDED
  +   if (subpool) {
  +       ap_destroy_pool(subpool);
  +   }
  +#else 
      if (cld->subprocess_env) {
          for (i = 0; i < env_arr->nelts; ++i) {
               if (!elts[i].key)
  @@ -271,6 +301,7 @@
               unsetenv (elts[i].key);
          }
      }
  +#endif /* TPF_FORK_EXTENDED */
   
      if (pipe_out) {
          close(out_fds[1]);
  @@ -354,7 +385,11 @@
       fork_input.istream = TPF_FORK_IS_BALANCE;
       fork_input.ebw_data_length = sizeof(input_parms);
       fork_input.parm_data = "-x";
  +#ifdef TPF_FORK_EXTENDED
  +    return tpf_fork(&fork_input, NULL, NULL);
  +#else
       return tpf_fork(&fork_input);
  +#endif /* TPF_FORK_EXTENDED */
   }
   
   void ap_tpf_zinet_checks(int standalone,
  @@ -713,4 +748,38 @@
       }
   
       return(0);
  +}
  +
  +/*
  +   This function augments http_main's show_compile_settings function.
  +   This way definitions that are only shown on TPF won't clutter up
  +   main line code.
  +*/
  +void show_os_specific_compile_settings(void)
  +{
  +
  +#ifdef USE_TPF_SCOREBOARD
  +    printf(" -D USE_TPF_SCOREBOARD\n");
  +#endif
  +
  +#ifdef TPF_FORK_EXTENDED
  +    printf(" -D TPF_FORK_EXTENDED\n"); 
  +#endif
  +
  +#ifdef TPF_HAVE_NONSOCKET_SELECT
  +    printf(" -D TPF_HAVE_NONSOCKET_SELECT\n"); 
  +#endif
  +
  +#ifdef TPF_NO_NONSOCKET_SELECT 
  +    printf(" -D TPF_NO_NONSOCKET_SELECT\n"); 
  +#endif
  +
  +#ifdef TPF_HAVE_SAWNC
  +    printf(" -D TPF_HAVE_SAWNC\n"); 
  +#endif
  +
  +#ifdef TPF_NO_SAWNC
  +    printf(" -D TPF_NO_SAWNC\n"); 
  +#endif
  +
   }
  
  
  
  1.14      +60 -5     apache-1.3/src/os/tpf/os.h
  
  Index: os.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/os/tpf/os.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- os.h	2001/05/12 02:37:23	1.13
  +++ os.h	2001/06/22 12:43:55	1.14
  @@ -1,8 +1,58 @@
   #ifndef APACHE_OS_H
   #define APACHE_OS_H
   
  +/*
  + * This file is included in all Apache source code. It contains definitions
  + * of facilities available on _this_ operating system (HAVE_* macros),
  + * and prototypes of OS specific functions defined in os.c or os-inline.c
  + */
  +
   #define PLATFORM "TPF"
   
  +/************************************************************************
  + *  PJ26895 provides support for non_socket_select.
  + *  You can determine if this apar is applied to your system by looking
  + *  at i$pwbl.h.  If the function non_socket_select is defined,
  + *  then add #define TPF_HAVE_NONSOCKET_SELECT
  + *  else add #define TPF_NO_NONSOCKET_SELECT
  + *
  + *  One of these two #defines is required and must be added here in os.h
  + *  before the following check.
  + ************************************************************************/
  +
  +#if !defined(TPF_HAVE_NONSOCKET_SELECT) && !defined(TPF_NO_NONSOCKET_SELECT)
  +   #error "You must define whether your system supports non_socket_select()"
  +   #error "See src/os/tpf/os.h for instructions"
  +#endif
  +
  +#if defined(TPF_HAVE_NONSOCKET_SELECT) && defined(TPF_NO_NONSOCKET_SELECT)
  +   #error "TPF_HAVE_NONSOCKET_SELECT and TPF_NO_NONSOCKET_SELECT"
  +   #error "cannot both be defined"
  +   #error "See src/os/tpf/os.h for instructions"
  +#endif
  +
  +/************************************************************************
  + *  PJ27387 or PJ26188 provides support for tpf_sawnc.
  + *  You can determine if this apar is applied to your system by looking at
  + *  tpfapi.h or i$fsdd.h.  If the function tpf_sawnc is defined,
  + *  then add #define TPF_HAVE_SAWNC
  + *  else add #define TPF_NO_SAWNC
  + *
  + *  One of these two #defines is required and must be added here in os.h
  + *  before the following check.
  + ************************************************************************/
  +
  +#if !defined(TPF_HAVE_SAWNC) && !defined(TPF_NO_SAWNC)
  +   #error "You must define whether your system supports tpf_sawnc()"
  +   #error "See src/os/tpf/os.h for instructions"
  +#endif
  +
  +#if defined(TPF_HAVE_SAWNC) && defined(TPF_NO_SAWNC)
  +   #error "TPF_HAVE_SAWNC and TPF_NO_SAWNC"
  +   #error "cannot both be defined"
  +   #error "See src/os/tpf/os.h for instructions"
  +#endif
  +
   /* if the compiler defined errno then undefine it
      and pick up the correct definition from errno.h */
   #if defined(errno) && !defined(__errnoh)
  @@ -10,12 +60,16 @@
   #include <errno.h>
   #endif
   
  -/*
  - * This file is included in all Apache source code. It contains definitions
  - * of facilities available on _this_ operating system (HAVE_* macros),
  - * and prototypes of OS specific functions defined in os.c or os-inline.c
  - */
  +/* If APAR PJ27277 (which shipped on PUT13) has been applied */
  +/* then we want to #define TPF_FORK_EXTENDED so Perl CGIs will work. */
  +/* Rather than hardcoding it we'll check for "environ" in stdlib.h, */
  +/* which was also added by PJ27277. */
  +#include <stdlib.h>
  +#if defined(environ) && !defined(TPF_FORK_EXTENDED)
  +#define TPF_FORK_EXTENDED
  +#endif
   
  +#include <sysapi.h>  
   #include "ap_config.h"
   
   #ifdef HAVE_ISNAN
  @@ -127,6 +181,7 @@
                            const char *servername,
                            struct server_rec *s);
   int os_check_server(char *server);
  +void show_os_specific_compile_settings(void);
   char *getpass(const char *prompt);
   int killpg(pid_t pgrp, int sig);
   extern char *ap_server_argv0;
  
  
  
  1.1690    +4 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1689
  retrieving revision 1.1690
  diff -u -r1.1689 -r1.1690
  --- CHANGES	2001/06/12 08:39:03	1.1689
  +++ CHANGES	2001/06/22 12:43:55	1.1690
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.21
   
  +  *) (TPF only) Take advantage of improvements to select(), fork(), and
  +     exec() in the TPF operating system.  
  +     [David McCreedy <McCreedy@us.ibm.com>]
  +
     *) (Cygwin only) Fix problems with signals sent to child processes;
        Improve auto-configuration for Cygwin.
        [Stipe Tolj <tolj@wapme-systems.de>]
  
  
  

Mime
View raw message