httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r208785 - in /httpd/httpd/trunk: include/ap_mmn.h include/http_core.h server/core.c
Date Fri, 01 Jul 2005 19:39:28 GMT
Author: wrowe
Date: Fri Jul  1 12:39:26 2005
New Revision: 208785

URL: http://svn.apache.org/viewcvs?rev=208785&view=rev
Log:

  Initially a no-op.  Add trace_enable configuration.  The http and proxy
  flavors of interpreting this flag are yet to be committed.

Modified:
    httpd/httpd/trunk/include/ap_mmn.h
    httpd/httpd/trunk/include/http_core.h
    httpd/httpd/trunk/server/core.c

Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/include/ap_mmn.h?rev=208785&r1=208784&r2=208785&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Fri Jul  1 12:39:26 2005
@@ -97,14 +97,15 @@
  * 20050305.2 (2.1.5-dev) added AP_INIT_TAKE_ARGV.
  * 20050305.3 (2.1.5-dev) added Protocol Framework.
  * 20050701.0 (2.1.7-dev) Bump MODULE_MAGIC_COOKIE to "AP21"!
- */
+ * 20050701.1 (2.1.7-dev) trace_enable member added to core server_config
+  */
 
 #define MODULE_MAGIC_COOKIE 0x41503231UL /* "AP21" */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20050701
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1                     /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a

Modified: httpd/httpd/trunk/include/http_core.h
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/include/http_core.h?rev=208785&r1=208784&r2=208785&view=diff
==============================================================================
--- httpd/httpd/trunk/include/http_core.h (original)
+++ httpd/httpd/trunk/include/http_core.h Fri Jul  1 12:39:26 2005
@@ -551,6 +551,14 @@
 
     const char *protocol;
     apr_table_t *accf_map;
+
+    /* TRACE control */
+#define AP_TRACE_UNSET    -1
+#define AP_TRACE_DISABLE   0
+#define AP_TRACE_ENABLE    1
+#define AP_TRACE_EXTENDED  2
+    int trace_enable;
+
 } core_server_config;
 
 /* for AddOutputFiltersByType in core.c */

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/server/core.c?rev=208785&r1=208784&r2=208785&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Fri Jul  1 12:39:26 2005
@@ -482,6 +482,8 @@
     apr_table_set(conf->accf_map, "https", "dataready");
 #endif
 
+    conf->trace_enable = AP_TRACE_UNSET;
+
     return (void *)conf;
 }
 
@@ -516,6 +518,11 @@
     conf->subreq_limit = virt->subreq_limit
                          ? virt->subreq_limit
                          : base->subreq_limit;
+
+    conf->trace_enable = (virt->trace_enable != AP_TRACE_UNSET)
+                         ? virt->trace_enable
+                         : base->trace_enable;
+
     return conf;
 }
 
@@ -1724,7 +1731,7 @@
         methnum = ap_method_number_of(method);
 
         if (methnum == M_TRACE && !tog) {
-            return "TRACE cannot be controlled by <Limit>";
+            return "TRACE cannot be controlled by <Limit>, see TraceEnable";
         }
         else if (methnum == M_INVALID) {
             /* method has not been registered yet, but resorce restriction
@@ -3119,6 +3126,28 @@
     return;
 }
 
+static const char *set_trace_enable(cmd_parms *cmd, void *dummy,
+                                    const char *arg1)
+{
+    core_server_config *conf = ap_get_module_config(cmd->server->module_config,
+                                                    &core_module);
+    
+    if (strcasecmp(arg1, "on") == 0) {
+        conf->trace_enable = AP_TRACE_ENABLE;
+    }
+    else if (strcasecmp(arg1, "off") == 0) {
+        conf->trace_enable = AP_TRACE_DISABLE;
+    }
+    else if (strcasecmp(arg1, "extended") == 0) {
+        conf->trace_enable = AP_TRACE_EXTENDED;
+    }
+    else {
+        return "TraceEnable must be one of 'on', 'off', or 'extended'";
+    }
+
+    return NULL;
+}
+
 /* Note --- ErrorDocument will now work from .htaccess files.
  * The AllowOverride of Fileinfo allows webmasters to turn it off
  */
@@ -3346,6 +3375,8 @@
 AP_INIT_TAKE1("EnableExceptionHook", ap_mpm_set_exception_hook, NULL, RSRC_CONF,
               "Controls whether exception hook may be called after a crash"),
 #endif
+AP_INIT_TAKE1("TraceEnable", set_trace_enable, NULL, RSRC_CONF, 
+              "'on' (default), 'off' or 'extended' to trace request body content"),
 { NULL }
 };
 



Mime
View raw message