You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/07/29 05:08:13 UTC

cvs commit: apache-2.0/src/modules/standard mod_rewrite.c mod_include.c

trawick     00/07/28 20:08:13

  Modified:    src      CHANGES
               src/modules/standard mod_rewrite.c mod_include.c
  Log:
  Change the storage allocation mechanism for ap_proc_t structures
  passed to ap_note_subprocess() by mod_rewrite and mod_include.  The
  storage needs to last as long as the pool passed to
  ap_note_subprocess(), so autodata won't work.
  
  The mod_rewrite change wasn't tested.  A normal build with mod_rewrite
  on Linux currently results in the link failing due to unresolved
  references to dbm_*.
  
  Revision  Changes    Path
  1.185     +2 -1      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.184
  retrieving revision 1.185
  diff -u -r1.184 -r1.185
  --- CHANGES	2000/07/29 02:04:49	1.184
  +++ CHANGES	2000/07/29 03:08:12	1.185
  @@ -10,7 +10,8 @@
     *) Register the mod_cgid daemon process for cleanup so that it is
        killed at termination if it does not die when the parent gets
        SIGTERM.  This change is to fix occasional problems where the
  -     process stays around.  [Jeff Trawick]
  +     process stays around.  Bugs in similar logic in mod_rewrite and
  +     mod_include were also fixed.  [Jeff Trawick]
   
     *) Fix a bug in the time handling.  Basically, we were imploding a time
        in ap_parseHTTPdate, but it had bogus data in the exploded time format.
  
  
  
  1.35      +7 -6      apache-2.0/src/modules/standard/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_rewrite.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- mod_rewrite.c	2000/07/25 00:58:21	1.34
  +++ mod_rewrite.c	2000/07/29 03:08:13	1.35
  @@ -3421,7 +3421,7 @@
   {
       int rc = -1;
       ap_procattr_t *procattr;
  -    ap_proc_t procnew;
  +    ap_proc_t *procnew;
   
   #ifdef SIGHUP
       ap_signal(SIGHUP, SIG_IGN);
  @@ -3439,21 +3439,22 @@
           rc = -1;
       }
       else {
  -        rc = ap_create_process(&procnew, progname, NULL, NULL, procattr, p);
  +        procnew = ap_pcalloc(p, sizeof(*procnew));
  +        rc = ap_create_process(procnew, progname, NULL, NULL, procattr, p);
       
           if (rc == APR_SUCCESS) {
  -            ap_note_subprocess(p, &procnew, kill_after_timeout);
  +            ap_note_subprocess(p, procnew, kill_after_timeout);
   
               if (fpin) {
  -                (*fpin) = procnew.in;
  +                (*fpin) = procnew->in;
               }
   
               if (fpout) {
  -                (*fpout) = procnew.out;
  +                (*fpout) = procnew->out;
               }
   
               if (fperr) {
  -                (*fperr) = procnew.err;
  +                (*fperr) = procnew->err;
               }
           }
       }
  
  
  
  1.48      +5 -4      apache-2.0/src/modules/standard/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_include.c,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- mod_include.c	2000/07/26 01:56:02	1.47
  +++ mod_include.c	2000/07/29 03:08:13	1.48
  @@ -831,7 +831,7 @@
       include_cmd_arg arg;
       BUFF *script_in;
       ap_procattr_t *procattr;
  -    ap_proc_t procnew;
  +    ap_proc_t *procnew;
       ap_status_t rc;
       ap_table_t *env = r->subprocess_env;
       char **argv;
  @@ -896,7 +896,8 @@
       else {
           build_argv_list(&argv, r, r->pool);
           argv[0] = ap_pstrdup(r->pool, s);
  -        rc = ap_create_process(&procnew, s, argv, ap_create_environment(r->pool, env), procattr, r->pool);
  +        procnew = ap_pcalloc(r->pool, sizeof(*procnew));
  +        rc = ap_create_process(procnew, s, argv, ap_create_environment(r->pool, env), procattr, r->pool);
   
           if (rc != APR_SUCCESS) {
               /* Bad things happened. Everyone should have cleaned up. */
  @@ -904,9 +905,9 @@
                           "couldn't create child process: %d: %s", rc, s);
           }
           else {
  -            ap_note_subprocess(r->pool, &procnew, kill_after_timeout);
  +            ap_note_subprocess(r->pool, procnew, kill_after_timeout);
               /* Fill in BUFF structure for parents pipe to child's stdout */
  -            file = procnew.out;
  +            file = procnew->out;
               iol = ap_create_file_iol(file);
               if (!iol)
                   return APR_EBADF;