httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: New config work...
Date Sat, 03 Jun 2000 01:07:19 GMT
If I understand this correctly, the overall strategy that you're going
for here isn't going to quite work. When you enter ap_build_config(), the
"current" must be initialized properly.

Hmm. Actually, it shouldn't be too much code:

  current = conftree;
  if (current != NULL)
    while (current->next != NULL)
      current = current->next;


Oh: Include directives' resulting trees are not hooked into the config
tree for later execution. Before this patch, an Include directive would
parse/exec the include file before returning. With this patch, it only
parses the file :-)


On Fri, 2 Jun 2000 rbb@covalent.net wrote:
>...
> @@ -403,7 +403,11 @@
>  
>  CORE_EXPORT(const char *) ap_init_virtual_host(ap_pool_t *p, const char *hostname,
>  				server_rec *main_server, server_rec **);
> -void ap_process_resource_config(server_rec *s, const char *fname, ap_pool_t *p, ap_pool_t
*ptemp);
> +ap_directive_t *ap_process_resource_config(server_rec *s, const char *fname, 
> +                     ap_directive_t *conftree, ap_pool_t *p, ap_pool_t *ptemp);
> +void ap_process_config_tree(server_rec *s, ap_directive_t *conftree,
> +                            ap_pool_t *p, ap_pool_t *ptemp);

I think it would be better to have these use "ap_directive_t **conftree",
and continue to return void to the caller.

I'd like to update them in the future to return the errmsg (rather than
doing an exit()).

The **conftree pattern is also pretty common.

>...
> +void ap_process_config_tree(server_rec *s, ap_directive_t *conftree,
> +                            ap_pool_t *p, ap_pool_t *ptemp)
> +{
> +    const char *errmsg;
> +    cmd_parms parms;
> +
> +    parms = default_parms;
> +    parms.pool = p;
> +    parms.temp_pool = ptemp;
> +    parms.server = s;
> +    parms.override = (RSRC_CONF | OR_ALL) & ~(OR_AUTHCFG | OR_LIMIT);
>  
> +    errmsg = ap_walk_config(conftree, &parms, s->lookup_defaults);
> +    if (errmsg) {
> +        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
> +                     "Syntax error on line %d of %s:",
> +                     parms.err_directive->line_num,
> +                     parms.err_directive->filename);
> +        exit(1);

The errmsg should also be logged (like ap_process_resource_config() does)


Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/


Mime
View raw message