httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dave <man...@gmail.com>
Subject Re: WELCOME to modules-dev@httpd.apache.org
Date Wed, 11 Feb 2009 18:30:57 GMT
On Wed, Feb 11, 2009 at 13:21, Eric Covener <covener@gmail.com> wrote:

> On Wed, Feb 11, 2009 at 1:18 PM, dave <mankyd@gmail.com> wrote:
> > acfg and bcfg are the arguments to the merge calback. cfg is the result
> that
> > the merge callback returns
> > ...
> > merge_server    {acfg: 0x2b45d35e79d0    bcfg:0x2b45dc2385f0    cfg:
> > 0x2b45dc26fff0}
> > merge_dir    {acfg: 0x2b45d35e79e8    bcfg:0x2b45dc2385d8    cfg:
> > 0x2b45dc270458}
> > child_init    {pid: 2800    cfg:0x2b45d35e79d0        server:
> > 0x2b45d355f968} <-- recieving the acfg from the merge_server, not the
> return
> > value of the merge_server
> > create new
> > handler        {pid: 2800    cfg:0x2b45dc26fff0        server:
> > 0x2b45dc2361b8}  <-- recieving the return value of the merge_server
> > create new
>
> is this from passing r->server? Are you sure your request was mapped
> to a virtualhost?
>
> --
> Eric Covener
> covener@gmail.com
>

It's definitely setup as a virtual host.


I have this in my child_init:

static void my_child_init(apr_pool_t *p, server_rec *s) {
    printf("child_init\t{pid: %d\tcfg:%p\t\tserver: %p}\n", getpid(),
ap_get_module_config(s->module_config, &my_module), s);

    //...
}

My handler:

static int my_handler(request_rec *r) {
    //...
    printf("handler\t\t{pid: %d\tcfg:%p\t\tserver: %p}\n", getpid(),
ap_get_module_config(r->server->module_config, &my_module), r->server);
    //...
}

And my merge_server:

static void *my_merge_server_config(apr_pool_t *p, void *base, void *add) {
    my_config *cfg = (my_config *)apr_pcalloc(p, sizeof(my_config));
    //...

    printf("merge_server\t{acfg: %p\tbcfg:%p\tcfg: %p}\n", base, add, cfg);

    return (void *)cfg;
}


Here was the full output of  my debug code if its of any use:

server_config    {pid: 2800    cfg:0x2b45d35e0ac0    server: 0x2b45d3562568}
dir_config    {pid: 2800    cfg:0x2b45d35e0ad8    path: (null)}
dir_config    {pid: 2800    cfg:0x2b45dc2365c8    path: (null)}
server_config    {pid: 2800    cfg:0x2b45dc2365e0    server: 0x2b45dc2341a8}
mapper    {pid: 2800    cfg:0x2b45dc2365c8        cmd_parms: 0x7fffd77e4cd0}
merge_server    {acfg: 0x2b45d35e0ac0    bcfg:0x2b45dc2365e0    cfg:
0x2b45dc237e30}
merge_dir    {acfg: 0x2b45d35e0ad8    bcfg:0x2b45dc2365c8    cfg:
0x2b45dc238298}
server_config    {pid: 2800    cfg:0x2b45d35e79d0    server: 0x2b45d355f968}
dir_config    {pid: 2800    cfg:0x2b45d35e79e8    path: (null)}
dir_config    {pid: 2800    cfg:0x2b45dc2385d8    path: (null)}
server_config    {pid: 2800    cfg:0x2b45dc2385f0    server: 0x2b45dc2361b8}
mapper    {pid: 2800    cfg:0x2b45dc2385d8        cmd_parms: 0x7fffd77e4cd0}
merge_server    {acfg: 0x2b45d35e79d0    bcfg:0x2b45dc2385f0    cfg:
0x2b45dc26fff0}
merge_dir    {acfg: 0x2b45d35e79e8    bcfg:0x2b45dc2385d8    cfg:
0x2b45dc270458}
child_init    {pid: 2800    cfg:0x2b45d35e79d0        server:
0x2b45d355f968}
create new
handler        {pid: 2800    cfg:0x2b45dc26fff0        server:
0x2b45dc2361b8}
create new


-dave
mankyd@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message