You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2015/01/30 17:58:20 UTC

svn commit: r1656058 - in /httpd/httpd/trunk: include/ap_mmn.h include/http_config.h server/config.c

Author: covener
Date: Fri Jan 30 16:58:20 2015
New Revision: 1656058

URL: http://svn.apache.org/r1656058
Log:
Provide a way for EXEC_ON_READ directives to see their context
(parent directive).

Usually, this context is not also EXEC_ON_READ so it's not fully processed, so
e.g cmd->path is not fluffed up yet because the closing tag
of the section is not read yet and ap_check_cmd_context()
doesn't work)



Modified:
    httpd/httpd/trunk/include/ap_mmn.h
    httpd/httpd/trunk/include/http_config.h
    httpd/httpd/trunk/server/config.c

Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=1656058&r1=1656057&r2=1656058&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Fri Jan 30 16:58:20 2015
@@ -477,6 +477,7 @@
  *                         core_dir_config
  * 20140627.10 (2.5.0-dev) Add ap_proxy_de_socketfy to mod_proxy.h
  * 20150121.0 (2.5.0-dev)  Revert field addition from core_dir_config; r1653666
+ * 20150121.1 (2.5.0-dev)  Add cmd_parms_struct.parent to http_config.h
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
@@ -484,7 +485,7 @@
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20150121
 #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_config.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/http_config.h?rev=1656058&r1=1656057&r2=1656058&view=diff
==============================================================================
--- httpd/httpd/trunk/include/http_config.h (original)
+++ httpd/httpd/trunk/include/http_config.h Fri Jan 30 16:58:20 2015
@@ -325,7 +325,10 @@ struct cmd_parms_struct {
     struct ap_conf_vector_t *context;
     /** directive with syntax error */
     const ap_directive_t *err_directive;
-
+ 
+    /** If the current directive is EXEC_ON_READ, this is the 
+        enclosing directive  */
+    ap_directive_t *parent;
 };
 
 /**

Modified: httpd/httpd/trunk/server/config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/config.c?rev=1656058&r1=1656057&r2=1656058&view=diff
==============================================================================
--- httpd/httpd/trunk/server/config.c (original)
+++ httpd/httpd/trunk/server/config.c Fri Jan 30 16:58:20 2015
@@ -841,7 +841,8 @@ AP_DECLARE(module *) ap_find_linked_modu
 #define AP_MAX_ARGC 64
 
 static const char *invoke_cmd(const command_rec *cmd, cmd_parms *parms,
-                              void *mconfig, const char *args)
+                              void *mconfig, const char *args, 
+                              ap_directive_t *parent)
 {
     int override_list_ok = 0;
     char *w, *w2, *w3;
@@ -870,6 +871,7 @@ static const char *invoke_cmd(const comm
 
     parms->info = cmd->cmd_data;
     parms->cmd = cmd;
+    parms->parent = parent;
 
     switch (cmd->args_how) {
     case RAW_ARGS:
@@ -1306,7 +1308,7 @@ static const char *ap_walk_config_sub(co
             continue;
         }
 
-        retval = invoke_cmd(cmd, parms, dir_config, current->args);
+        retval = invoke_cmd(cmd, parms, dir_config, current->args, NULL);
 
         if (retval != NULL && strcmp(retval, DECLINE_CMD) != 0) {
             /* If the directive in error has already been set, don't
@@ -1670,7 +1672,7 @@ static const char *execute_now(char *cmd
         const char *retval;
         cmd = ml->cmd;
 
-        retval = invoke_cmd(cmd, parms, sub_tree, args);
+        retval = invoke_cmd(cmd, parms, sub_tree, args, parent);
 
         if (retval != NULL) {
             return retval;