httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Wortham" <>
Subject Certain access results should call a new handler
Date Thu, 26 Apr 2007 23:08:19 GMT
I ran into a weird issue:
   My module is primarily access-based, but I do have a some other types of
hooks (a few content handlers and an output filter).

My access_checker hook function seems to work fine except when, in one
particular case, I need to respond to a specific access-condition with a
content handler.

That is to say, the possible values for access are {A, B, C, and D}.  If the
access for a particular request is "C", I need to call a content handler
function that should only run when access is "C" (and in no other case).

My assumption was that if I returned OK from the access_checker function
(which was registered with "ap_hook_access_checker(access_checker, ...)"),
that the request would be finished, wrapped up and Apache would not pass it
along the hook/handler chain.  This, apparently, is not the case (as far as
I can tell in my recent tests).

My content-handler just injects strings directly to the response then should
direct Apache to finish up the request (like returning OK from within a
content-handler function).

My ideal situation would be to register a content-handler function only when
access-condition "C" occurs and have that content-handler serve all of the

I am currently looking at this page to see what options are possible:

My questions are:
- is there a way to register a handler hook from within my access_checker
- is it possible to pass meta-data around in the request_rec?  (Is this
considered bad module-programming?)
- is my only viable option to run access checks both during the
access_checker phase and during the content-handler phase (and hope that my
"Access C" content handler is the first one called)?

Any other suggestions for how to deal with this situation or for example
code that deals with this?

David Wortham
Senior Web Applications Developer
Unspam Technologies, Inc.
1901 Prospector Dr. #30
Park City, UT 84060
(435) 513-0672

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