httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apache-1.3/src/main http_main.c
Date Fri, 21 Dec 2001 00:51:44 GMT
wrowe       01/12/20 16:51:44

  Modified:    src      CHANGES
               src/main http_main.c
  Log:
    One of two gdawful bugs in Apache/Win32, start capturing child errors.
    The other [significant] error is the tendancy for the parent to restart
    instantly on init errors, which are never corrected.  But that's a patch
    for another day.
  
  Revision  Changes    Path
  1.1747    +4 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1746
  retrieving revision 1.1747
  diff -u -r1.1746 -r1.1747
  --- CHANGES	2001/12/18 15:34:01	1.1746
  +++ CHANGES	2001/12/21 00:51:43	1.1747
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.23
   
  +  *) Cause Win32 to capture all child-worker process errors in
  +     Apache to the main server error log, until the child can
  +     open it's own error logs.  [William Rowe]
  +
     *) Revert mod_negotation's handling of path_info and query_args
        to the 1.3.20 behavior.  PR: 8628, 8582, 8538  [William Rowe]
   
  
  
  
  1.564     +8 -12     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.563
  retrieving revision 1.564
  diff -u -r1.563 -r1.564
  --- http_main.c	2001/12/18 15:20:57	1.563
  +++ http_main.c	2001/12/21 00:51:44	1.564
  @@ -6544,7 +6544,7 @@
       HANDLE hPipeWrite = NULL;
       HANDLE hPipeWriteDup;
       HANDLE hNullOutput = NULL;
  -    HANDLE hNullError = NULL;
  +    HANDLE hShareError = NULL;
       HANDLE hCurrentProcess;
       SECURITY_ATTRIBUTES sa = {0};  
   
  @@ -6610,14 +6610,12 @@
           return -1;
       }
   
  -    /* Open a null handle to soak info from the child */
  -    hNullError = CreateFile("nul", GENERIC_READ | GENERIC_WRITE, 
  -                            FILE_SHARE_READ | FILE_SHARE_WRITE, 
  -                            &sa, OPEN_EXISTING, 0, NULL);
  -    if (hNullError == INVALID_HANDLE_VALUE) {
  -        ap_log_error(APLOG_MARK, APLOG_WIN32ERROR | APLOG_CRIT, server_conf,
  -                     "Parent: Unable to create null error pipe for child process.\n");
  -        return -1;
  +    /* Child's initial stderr -> our main server error log (or, failing that, stderr)
*/
  +    if (server_conf->error_log) {
  +        hShareError = (HANDLE)_get_osfhandle(fileno(server_conf->error_log));
  +        if (hShareError == INVALID_HANDLE_VALUE) {
  +            hShareError = GetStdHandle(STD_ERROR_HANDLE);
  +        }
       }
   
       hCurrentProcess = GetCurrentProcess();
  @@ -6638,7 +6636,7 @@
       si.wShowWindow = SW_HIDE;
       si.hStdInput   = hPipeRead;
       si.hStdOutput  = hNullOutput;
  -    si.hStdError   = hNullError;
  +    si.hStdError   = hShareError;
   
       if (!CreateProcess(NULL, pCommand, NULL, NULL, 
                          TRUE,      /* Inherit handles */
  @@ -6656,7 +6654,6 @@
           CloseHandle(hPipeRead);
           CloseHandle(hPipeWrite);        
           CloseHandle(hNullOutput);
  -        CloseHandle(hNullError);        
   
           return -1;
       }
  @@ -6704,7 +6701,6 @@
       CloseHandle(hPipeRead);
       CloseHandle(hPipeWrite);        
       CloseHandle(hNullOutput);
  -    CloseHandle(hNullError);        
   
       return 0;
   }
  
  
  

Mime
View raw message