]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
PR#566: mod_status dumps core in inetd mode
authordgaudet <dgaudet@unknown>
Fri, 27 Jun 1997 01:51:50 +0000 (01:51 +0000)
committerdgaudet <dgaudet@unknown>
Fri, 27 Jun 1997 01:51:50 +0000 (01:51 +0000)
Submitted by: Marc Slemko and Roy Fielding
Reviewed by:  Marc Slemko, Roy Fielding, Alexei Kosut

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3@78375 13f79535-47bb-0310-9956-ffa450edef68

APACHE_1_2_X/src/CHANGES
APACHE_1_2_X/src/include/scoreboard.h
APACHE_1_2_X/src/main/http_main.c
APACHE_1_2_X/src/modules/standard/mod_status.c

index ea91e82b4e11c9f4fe33e3993290c4074b225f46..56f9174723396c9fb6b572b5fc781c9135512949 100644 (file)
@@ -1,5 +1,8 @@
 Changes with Apache 1.2.1
 
+  *) PR#566: mod_status dumps core in inetd mode.
+     [Marc Slemko and Roy Fielding]
+
   *) Attempt to work around problems with third party libraries that do not
      handle high numbered descriptors (examples include bind, and
      solaris libc).  On all systems apache attempts to keep all permanent
index 1485a45a9a5c89c97e5dfdf1c558000bec7417ad..5aa808cb4d61e9ea088c1fa6552eb316575e36cd 100644 (file)
@@ -107,4 +107,4 @@ typedef struct
 
 extern void sync_scoreboard_image(void);
 short_score get_scoreboard_info(int x);
-
+int exists_scoreboard_image ();
index 348ca039c3b858bc96c40318d8356dcba66e4ba5..642d037cd00f503e56bffb3b6164b9332198ec98 100644 (file)
@@ -941,6 +941,11 @@ void sync_scoreboard_image ()
 #endif
 }
 
+int exists_scoreboard_image ()
+{
+    return (scoreboard_image ? 1 : 0);
+}
+
 int update_child_status (int child_num, int status, request_rec *r)
 {
     int old_status;
index da0073a59a3fbcbc7e7cc308c16cb49df06118d2..e2059cd03a8375d824900e6352f1c2679c1b60d5 100644 (file)
@@ -95,6 +95,7 @@
 #include "util_script.h"
 #include <time.h>
 #include "scoreboard.h"
+#include "http_log.h"
 
 #ifdef NEXT
 #include <machine/param.h>
@@ -229,7 +230,14 @@ int status_handler (request_rec *r)
     status[SERVER_BUSY_DNS]='D';
     status[SERVER_GRACEFUL]='G';
 
-    if (r->method_number != M_GET) return NOT_IMPLEMENTED;
+    if (!exists_scoreboard_image()) {
+         log_printf(r->server, "Server status unavailable in inetd mode");
+         return HTTP_NOT_IMPLEMENTED;
+     }
+    r->allowed = (1 << M_GET) | (1 << M_TRACE);
+    if (r->method_number != M_GET) return HTTP_METHOD_NOT_ALLOWED;
+    if (!exists_scoreboard_image()) return HTTP_NOT_IMPLEMENTED;
+
     r->content_type = "text/html";
 
     /*