www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Stumpf <m...@space.net>
Subject general/4610: Add Define command to the server configuration (mimics -D switch)
Date Fri, 18 Jun 1999 19:13:28 GMT

>Number:         4610
>Category:       general
>Synopsis:       Add Define command to the server configuration (mimics -D switch)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Fri Jun 18 12:20:00 PDT 1999
>Last-Modified:
>Originator:     maex@space.net
>Organization:
apache
>Release:        1.3.6
>Environment:
n.a.
>Description:
For more flexibility it would be nice to have a "Define" command
similar to the -D switch on startup for use with <IfDefine>
>How-To-Repeat:
n.a.
>Fix:
a patch is included. Please check whether GLOBAL_ONLY is a good context
and whether use of strdup() is ok.

diff:
*** src/main/http_core.c.old    Sat Mar 20 00:54:08 1999
--- src/main/http_core.c        Fri Jun 18 21:10:57 1999
***************
*** 1869,1874 ****
--- 1869,1892 ----
      return NULL;
  }
  
+ static const char *set_define(cmd_parms *cmd, void *dummy, char *arg)
+ {
+     char **new;
+     const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
+ 
+     if (err != NULL) {
+         return err;
+     }
+ 
+     if (ap_exists_config_define(arg)) {
+       return NULL ;
+     }
+ 
+     new = (char **)ap_push_array(ap_server_config_defines);
+     *new = strdup(arg);
+     return NULL;
+ }
+ 
  static const char *set_user(cmd_parms *cmd, void *dummy, char *arg)
  {
  #ifdef WIN32
***************
*** 2741,2746 ****
--- 2759,2766 ----
  
  /* Old server config file commands */
  
+ { "Define", set_define, NULL, RSRC_CONF, TAKE1,
+   "define a name for use in <IfDefine nae> directives"},
  { "ServerType", server_type, NULL, RSRC_CONF, TAKE1,
    "'inetd' or 'standalone'"},
  { "Port", server_port, NULL, RSRC_CONF, TAKE1, "A TCP port number"},
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <apbugs@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]




Mime
View raw message