Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

patch for inetd

From: Alexei Kosut <akosut(at)organic.com>
Date: Fri Jun 21 1996 - 16:56:05 EDT


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

  /* 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 http://www.nueva.pvt.k12.ca.us/~akosut/ http://www.apache.org/
Received on Fri Jun 21 13:56:30 1996

This archive was generated by hypermail 2.1.8 : Thu Aug 24 2006 - 14:43:43 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library