You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Akins <ba...@web.turner.com> on 2004/06/23 16:31:08 UTC
mod_status hook
How do I register a mod_status hook. Looking at the code, I figure I
register a hook using "ap_hook_status_hook" (if I try anything else, I
get a complier warning). However I get "undefined symbol:
ap_hook_status_hook" when I try to run.
Obviously, I'm missing something...
--
Brian Akins
Senior Systems Engineer
CNN Internet Technologies
Re: mod_status hook (fixed)
Posted by Edward Rudd <ed...@omegaware.com>.
On Wed, 23 Jun 2004 14:58:04 -0400, Brian Akins wrote:
> Edward Rudd wrote:
>
>>
>>The 6th (or 1st) argument is only required when using 2.1-HEAD (apr-util
>>1.0).. Apache 2.0/APR-util 0.9.5 don't have this extra argument.
>>
>>
>>
>>
> $ grep APR_OPTIONAL_HOOK /opt/apache/include/*
> ...
> /opt/apache/include/ap_config.h:
> APR_OPTIONAL_HOOK(ap,name,fn,pre,succ,order)
> ...
>
Ahh. I found out why.
I typed APR_OPTIONAL_HOOK in the e-mail but I used AP_OPTIONAL_HOOK in my
source.
use AP_OPTIONAL_HOOK as that includes the apache namespace (the ap)
already.
Re: mod_status hook
Posted by Brian Akins <ba...@web.turner.com>.
Edward Rudd wrote:
>
>The 6th (or 1st) argument is only required when using 2.1-HEAD (apr-util
>1.0).. Apache 2.0/APR-util 0.9.5 don't have this extra argument.
>
>
>
>
$ grep APR_OPTIONAL_HOOK /opt/apache/include/*
...
/opt/apache/include/ap_config.h:
APR_OPTIONAL_HOOK(ap,name,fn,pre,succ,order)
...
$ ls -l /opt/apache/lib/
...
-rw-r--r-- 1 bakins root 2837430 Apr 20 11:31 libapr-0.a
-rw-r--r-- 1 bakins root 759 Apr 20 11:31 libapr-0.la
lrwxrwxrwx 1 bakins root 17 Apr 20 11:31 libapr-0.so ->
libapr-0.so.0.9.5
lrwxrwxrwx 1 bakins root 17 Apr 20 11:31 libapr-0.so.0 ->
libapr-0.so.0.9.5
-rwxr-xr-x 1 bakins root 1334093 Apr 20 11:31 libapr-0.so.0.9.5
-rw-r--r-- 1 bakins root 1416122 Apr 20 11:31 libaprutil-0.a
-rw-r--r-- 1 bakins root 749 Apr 20 11:31 libaprutil-0.la
lrwxrwxrwx 1 bakins root 21 Apr 20 11:31 libaprutil-0.so
-> libaprutil-0.so.0.9.5
lrwxrwxrwx 1 bakins root 21 Apr 20 11:31
libaprutil-0.so.0 -> libaprutil-0.so.0.9.5
-rwxr-xr-x 1 bakins root 736314 Apr 20 11:31
libaprutil-0.so.0.9.5
...
--
Brian Akins
Senior Systems Engineer
CNN Internet Technologies
Re: mod_status hook
Posted by Edward Rudd <ed...@omegaware.com>.
On Wed, 23 Jun 2004 14:26:20 -0400, Brian Akins wrote:
> Edward Rudd wrote:
>
>>
>>
>>APR_OPTIONAL_HOOK(status_hook,my_status_hook, NULL,NULL,APR_HOOK_MIDDLE);
>>
>>
>>
> Thanks!
>
> I had to add another argument:
>
> APR_OPTIONAL_HOOK(ap, status_hook, my_status_hook, NULL, NULL, APR_HOOK_MIDDLE);
The 6th (or 1st) argument is only required when using 2.1-HEAD (apr-util
1.0).. Apache 2.0/APR-util 0.9.5 don't have this extra argument.
Re: mod_status hook
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Something seems amiss, we need a unique designation of the status
namespace because this is how win32 binds to a specific DLL, and
determines if the symbol is exported (e.g., from mod_status). If it is
exported from mod_status, we need a seperate 'status' namespace
rather than 'ap'. Flagging the note for followup.
Bill
At 01:26 PM 6/23/2004, Brian Akins wrote:
>Edward Rudd wrote:
>
>>
>>
>>APR_OPTIONAL_HOOK(status_hook,my_status_hook, NULL,NULL,APR_HOOK_MIDDLE);
>>
>>
>Thanks!
>
>I had to add another argument:
>
>APR_OPTIONAL_HOOK(ap, status_hook, my_status_hook, NULL, NULL, APR_HOOK_MIDDLE);
>
>
>
>--
>Brian Akins
>Senior Systems Engineer
>CNN Internet Technologies
Re: mod_status hook
Posted by Brian Akins <ba...@web.turner.com>.
Edward Rudd wrote:
>
>
>APR_OPTIONAL_HOOK(status_hook,my_status_hook, NULL,NULL,APR_HOOK_MIDDLE);
>
>
>
Thanks!
I had to add another argument:
APR_OPTIONAL_HOOK(ap, status_hook, my_status_hook, NULL, NULL, APR_HOOK_MIDDLE);
--
Brian Akins
Senior Systems Engineer
CNN Internet Technologies
Re: mod_status hook
Posted by Edward Rudd <ed...@omegaware.com>.
On Wed, 23 Jun 2004 10:31:08 -0400, Brian Akins wrote:
> How do I register a mod_status hook. Looking at the code, I figure I
> register a hook using "ap_hook_status_hook" (if I try anything else, I
> get a complier warning). However I get "undefined symbol:
> ap_hook_status_hook" when I try to run.
>
> Obviously, I'm missing something...
Make sure you are including mod_status.h in your module source.
And this is an optional hook so you should declare the hook like this.
int my_status_hook(request_rec *r, int flags)
{
return OK;
}
APR_OPTIONAL_HOOK(status_hook,my_status_hook, NULL,NULL,APR_HOOK_MIDDLE);
and you need to make sure that mod_status is loaded before your module,
otherwise the hook won't get enabled.