httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_log.c
Date Wed, 12 Jul 2000 18:40:30 GMT
stoddard    00/07/12 11:40:28

  Modified:    src/main http_log.c
  Log:
  Fix a nasty stack corruption. ap_proc_t should be allocated out of the same
  pool passed to ap_create_process. A little further down the road to getting
  reliable piped logs working on Win32.
  
  Revision  Changes    Path
  1.59      +10 -9     apache-2.0/src/main/http_log.c
  
  Index: http_log.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_log.c,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- http_log.c	2000/06/28 14:33:32	1.58
  +++ http_log.c	2000/07/12 18:40:26	1.59
  @@ -173,7 +173,7 @@
        */
       int rc = -1;
       ap_procattr_t *procattr;
  -    ap_proc_t procnew;
  +    ap_proc_t *procnew;
   
   #ifdef SIGHUP
       /* No concept of a child process on Win32 */
  @@ -194,11 +194,12 @@
           
           ap_tokenize_to_argv(progname, &args, p);
           pname = ap_pstrdup(p, args[0]);
  -        rc = ap_create_process(&procnew, pname, args, NULL, procattr, p);
  +        procnew = (ap_proc_t *) ap_palloc(p, sizeof(*procnew));
  +        rc = ap_create_process(procnew, pname, args, NULL, procattr, p);
       
           if (rc == APR_SUCCESS) {
  -            ap_note_subprocess(p, &procnew, kill_after_timeout);
  -            (*fpin) = procnew.in;
  +            ap_note_subprocess(p, procnew, kill_after_timeout);
  +            (*fpin) = procnew->in;
           }
       }
   
  @@ -586,7 +587,7 @@
   {
       int rc;
       ap_procattr_t *procattr;
  -    ap_proc_t procnew;
  +    ap_proc_t *procnew;
       ap_status_t status;
   
   #ifdef SIGHUP
  @@ -608,16 +609,16 @@
   
           ap_tokenize_to_argv(pl->program, &args, pl->p);
           pname = ap_pstrdup(pl->p, args[0]);
  - 
  -        rc = ap_create_process(&procnew, pname, args, NULL, procattr, pl->p);
  +        procnew = (ap_proc_t *) ap_palloc(p, sizeof(*procnew));
  +        rc = ap_create_process(procnew, pname, args, NULL, procattr, pl->p);
       
           if (rc == APR_SUCCESS) {            
               /* pjr - This no longer happens inside the child, */
               /*   I am assuming that if ap_create_process was  */
               /*   successful that the child is running.        */
               RAISE_SIGSTOP(PIPED_LOG_SPAWN); 
  -            pl->pid = &procnew;
  -            ap_register_other_child(&procnew, piped_log_maintenance, pl, 
  +            pl->pid = procnew;
  +            ap_register_other_child(procnew, piped_log_maintenance, pl, 
                                       ap_piped_log_write_fd(pl), pl->p);
           }
       }
  
  
  

Mime
View raw message