httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29755] New: - mod_usertrack should really use APR_HOOK_FIRST
Date Wed, 23 Jun 2004 09:49:14 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29755>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29755

mod_usertrack should really use APR_HOOK_FIRST

           Summary: mod_usertrack should really use APR_HOOK_FIRST
           Product: Apache httpd-2.0
           Version: 2.0.49
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: mod_usertrack
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: sjm@almamedia.fi


In short, we are running several large websites that have banner advertisements.
A friendly way to serve banners is to configure the IMG SRC tags so that
they refer to an apache server using mod_usertrack and mod_rewrite.
This way, we get a decently reliable visitor log and banner exposure log.
The redirect points to the "real" image server that gives long expire times
so that the browser does not have to download each banner every time,
but we still get nice logs for our advertisers.

The problem that we ran into, is that whenever you make a redirect from
mod_rewrite, the fixups hooks stop and mod_usertrack is never called.
So we don't get cookies logged when http status is 302.

I fixed this quite simply:

in mod_usertrack, modify the function

--- 8< ---
static void register_hooks(apr_pool_t *p)
{
    ap_hook_fixups(spot_cookie,NULL,NULL,APR_HOOK_MIDDLE);
}
--- 8< ---

to be

--- 8< ---
static void register_hooks(apr_pool_t *p)
{
    ap_hook_fixups(spot_cookie,NULL,NULL,APR_HOOK_FIRST);
}
--- 8< ---

...and make sure that mod_usertrack is loaded before mod_rewrite,
if using dynamic modules. We use RHEL3ES, and the apache distributed
by Red Hat is using dynamic modules for almost everything.

I would be very pleased if stock apache's mod_usertrack
would use APR_HOOK_FIRST in the future. I don't think
this small but important modification would break anything. :-o

P.S.

request.c says

AP_IMPLEMENT_HOOK_RUN_ALL(int,fixups,
                          (request_rec *r), (r), OK, DECLINED)

it took some time for me to find out that "RUN_ALL" here
does not mean "run all hooks in any case". It means actually
"run every hook until one of them does not return DECLINED or OK".
Sheesh.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message