httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sutton <p...@ukweb.com>
Subject Re: cvs commit: apachen/src/main alloc.c util_script.c
Date Mon, 20 Oct 1997 14:37:49 GMT
On 20 Oct 1997 ben@hyperreal.org wrote:
> ben         97/10/20 05:09:00
> 
>   Modified:    src/main alloc.c util_script.c
>   Log:
>   Fix CGI under Win95 (plus some error checking). This needs doing more carefully.

I rather wish that these had been committed separately. There are several
important bug fixes in this patch, and a couple of other changes. For
reference, they are:

  1.  Fix CGI so it works on Windows 95 (with / -> \ translation)
  2.  Avoid "premature end-of-headers" error under CGI if the CGI cannot
      be spawned
  3.  Change the pipe mode from TEXT to BINARY
  4.  Close second argument to dup2() in one case - is this
      necessary? 

Incidently I'm not sure that patch for item 2 is correct. The
spawn_child_err_core() function can still return -1, 0 or a PID from
Windows. It should return 0 or a PID. A return value of -1 will be treated
as a sucessful spawn by the parent, which is not correct. Also if the
return value is is 0 then the caller will log the spawn failure, so we
don't need to do this within alloc.c (which is at a too low a level to log
this anyway - it doesn't know the filename of the child process).

All of this can be fixed with this can be done with this simple patch
(from mail I sent about this bug on May 17th). 

//pcs

*** alloc.c     Sat May 17 04:50:18 1997
--- ../../apache_1_2b10_nt/src/alloc.c  Sun May 25 13:46:46 1997
***************
*** 1096,1101 ****
--- 1096,1102 ----
        }

        pid = (*func)(data);
+         if (pid == -1) pid = 0;
        if(!pid)
        {
            save_errno = errno;






Mime
View raw message