]> granicus.if.org Git - apache/commitdiff
Initially a no-op. Add trace_enable configuration. The http and proxy
authorWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 1 Jul 2005 19:39:26 +0000 (19:39 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 1 Jul 2005 19:39:26 +0000 (19:39 +0000)
  flavors of interpreting this flag are yet to be committed.

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

include/ap_mmn.h
include/http_core.h
server/core.c

index 4724ab38172c40c9152b337d4acdc44881bd0148..268ba353b34a46c1fd30a9b4ad382be4863c5455 100644 (file)
  * 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
index e22b7bb909c8bdb9414a6bffa4047f75f323466e..d25f93c9765fa1c01df900d6d7cebec3e0d84ced 100644 (file)
@@ -551,6 +551,14 @@ typedef struct {
 
     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 */
index 2bf34fbe28ab32d6adf1ed306953ed8b93b5cffc..150f361e95e65b0e6967e05cbaebdca679ea5c80 100644 (file)
@@ -482,6 +482,8 @@ static void *create_core_server_config(apr_pool_t *a, server_rec *s)
     apr_table_set(conf->accf_map, "https", "dataready");
 #endif
 
+    conf->trace_enable = AP_TRACE_UNSET;
+
     return (void *)conf;
 }
 
@@ -516,6 +518,11 @@ static void *merge_core_server_configs(apr_pool_t *p, void *basev, void *virtv)
     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 @@ AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd,
         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 @@ void ap_add_output_filters_by_type(request_rec *r)
     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("ThreadStackSize", ap_mpm_set_thread_stacksize, NULL, RSRC_CONF,
 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 }
 };