httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject patch for inetd
Date Fri, 21 Jun 1996 20:56:05 GMT
Here's a patch to make CGI scripts with with inetd, since in the current
release they don't, as has been pointed out to us.

It's an unhappy fix, but it works. The problem is that cleanup_for_exec
ends up (through no fault of its own), closing stdout, because spawn_child
tells it to. Because in the standalone version, you only want the child to
have stdout, not the parent. Unfortunately, in the inetd version, the
parent still needs stdout, because (duh) that's where it writes to.

The other is not to call note_cleanups_for_file in spawn_child() for inetd
servers, but they should amount to the same thing. And because all inetd
processes last for only one connection, I don't think it's too much of a
problem not cleaning all the fds up properly.

Anyhoo, here's the patch. While I think it might be a good idea to excise 
inetd support from future versions, for now, we still make a pretense at
supporting it, and presumably CGI should work.

Index: mod_cgi.c
RCS file: /export/home/cvs/apache/src/mod_cgi.c,v
retrieving revision 1.10
diff -c -r1.10 mod_cgi.c
*** mod_cgi.c	1996/06/17 20:43:47	1.10
--- mod_cgi.c	1996/06/21 20:51:30
*** 72,77 ****
--- 72,78 ----
  #include "http_protocol.h"
  #include "http_main.h"
  #include "http_log.h"
+ #include "http_conf_globals.h"
  #include "util_script.h"
  /* KLUDGE --- for back-combatibility, we don't have to check ExecCGI
*** 142,148 ****
       * NB only ISINDEX scripts get decoded arguments.
!     cleanup_for_exec();
  #ifdef __EMX__    
      if((!r->args) || (!r->args[0]) || (ind(r->args,'=') >= 0)) {
--- 143,150 ----
       * NB only ISINDEX scripts get decoded arguments.
!     if (standalone)
!       cleanup_for_exec();
  #ifdef __EMX__    
      if((!r->args) || (!r->args[0]) || (ind(r->args,'=') >= 0)) {

-- Alexei Kosut <>            The Apache HTTP Server

View raw message