You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by James G Smith <JG...@TAMU.Edu> on 2000/06/30 17:12:23 UTC

Re: Config directives question

Matt Sergeant <ma...@sergeant.org> wrote:
>Is there any way I can write RAW_ARGS config directives like:
>
><AxMedia screen>
>...
></AxMedia>
>
>And have the bit between the tags passed through to apache for processing?
>The eagle book only seems to detail processing all the directives between
>the tags myself. But I want to be more modular than that. Am I missing
>some documentation somewhere?

Not sure if this helps, but digging around in Apache 1.3.12 came up with

  CORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, 
const char *l)
  API_EXPORT(const char *) ap_srm_command_loop(cmd_parms *parms, void *config)

The second one explains the first thus:

    while (!(ap_cfg_getline(l, MAX_STRING_LEN, parms->config_file))) { 
        const char *errmsg = ap_handle_command(parms, config, l);
        if (errmsg) {
            return errmsg;
        }
    }

The first one is not to be used outside the core, but it would seem to be what 
you are wanting.  (Lines 981 - 1029 of src/main/http_config.c)

However, looking in http_core.c around line 1200 reveals the following comment:

 /* access.conf commands...
 *
 * The *only* thing that can appear in access.conf at top level is a
 * <Directory> section.  NB we need to have a way to cut the srm_command_loop
 * invoked by dirsection (i.e., <Directory>) short when </Directory> is seen.
 * We do that by returning an error, which dirsection itself recognizes and
 * discards as harmless.  Cheesy, but it works.
 */

So... you can make </Axmedia> return an error, recognize it as such, and
continue on with the config file...  Everything between <Axmedia> and 
</Axmedia> is then read by the regular Apache config process using the 
ap_srm_command_loop call, which is an exported api call.

Not sure how this translates to perl without looking in the mod_perl book, 
which happens to not be with me at the moment, but perhaps this can point you 
in the right direction.
-- 
James Smith <JG...@TAMU.Edu>, 979-862-3725
Texas A&M CIS Operating Systems Group, Unix