httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject [PATCH] runtime inetd/standalone toggle (fwd)
Date Mon, 22 Sep 1997 21:39:43 GMT

I've extracted the README and 1.3a1 patch and attached them.

We probably don't want this considering our dislike of inetd.

not acked.

---------- Forwarded message ----------
Date: Mon, 22 Sep 1997 20:43:54 +0200
From: Marek Gresko <gresko@elf.stuba.sk>
To: apache-bugs@apache.org

I'm sorry but I didn't find better place where to mail.
This is not a bug. I made only some extension to apache.

See README for details.

In this uuencoded file there are patches for apache_1.2.4
and apache_1.3a1 -- please mail me if you find it useful.

Thanks
				Marek Gresko


begin 644 apache.tar.gz
M'XL(`*VX)C0``^P\:W/;1I+Y2OZ*%E-G$1)%B7HEL2S'-$59K$BDC@][74D*
M"P)#$2L0X.&AQ]K:_W4_ZG["55UWSP`$0$BR$R?QU@F5F.3,=$]W3T^_9J!^
<0i

<snip>


-=-=-=-


	I did an extension to a apache_1.3a1 and apache_1.2.4 in file
	http_core.c that adds support for Servermode auto in httpd.conf

	I find it very usefull so I decided to send it to you

					Marek Gresko

--------------------------------------------------------------------------------

    apache_version.patch -- a patch file that adds support for Servermode auto
    http_core.c.version -- the only file this patch changes
    Copyright (C) 1997  Marek Gresko

    Marek Gre¹ko		Marek Gresko
    Matu¹kova 1640/14-31	Matuskova 1640/14-31
    026 01 Dolný Kubín		026 01 Dolny Kubin

    Slovak Republic		e-mail: gresko@decef.elf.stuba.sk



--- apache_1.3a1/src/http_core.c.orig	Fri Sep 19 19:41:52 1997
+++ apache_1.3a1/src/http_core.c	Fri Sep 19 19:16:23 1997
@@ -62,6 +62,8 @@
 #include "rfc1413.h"
 #include "util_md5.h"
 #include "scoreboard.h"
+#include <syslog.h>
+#include <sys/stat.h>
 
 /* Server core module... This module provides support for really basic
  * server operations, including options and commands which control the
@@ -860,11 +862,25 @@
     return NULL;
 }
 
+static int getmode()
+{
+	struct stat x;
+
+	if (fstat(0,&x)<0)
+	{
+		syslog(LOG_ERR|LOG_DAEMON,"fstat -- use server mode 'standalone' or 'inetd'");
+		exit(-1);
+	}
+
+	return ((x.st_mode>>12) != (S_IFSOCK>>12));
+}
+
 const char *server_type (cmd_parms *cmd, void *dummy, char *arg)
 {
     if (!strcasecmp (arg, "inetd")) standalone = 0;
     else if (!strcasecmp (arg, "standalone")) standalone = 1;
-    else return "ServerType must be either 'inetd' or 'standalone'";
+    else if (!strcasecmp (arg, "auto")) standalone=getmode();
+    else return "ServerType must be either 'inetd' or 'standalone' or 'auto'";
 
     return NULL;
 }
@@ -1243,7 +1259,7 @@
 
 /* Old server config file commands */
 
-{ "ServerType", server_type, NULL, RSRC_CONF, TAKE1,"'inetd' or 'standalone'"},
+{ "ServerType", server_type, NULL, RSRC_CONF, TAKE1,"'inetd' or 'standalone' or 'auto'"},
 { "Port", server_port, NULL, RSRC_CONF, TAKE1, "A TCP port number"},
 { "HostnameLookups", set_hostname_lookups, NULL, ACCESS_CONF|RSRC_CONF, FLAG, "\"on\" to
enable or \"off\" to disable reverse DNS lookups" },
 { "User", set_user, NULL, RSRC_CONF, TAKE1, "Effective user id for this server"},


Mime
View raw message