On Wed, Aug 18, 2010 at 14:24, Martin Townsend
<martin.towns...@power-oasis.com> wrote:
>
>  Hi,
>
> I'm currently trying to add the ability to redirect requests for the initial
> html page to a captcha page when there is no session or no valid session.
>  Currently I'm doing this in the fixups hook:
>
> mod_smu_fixups(request_rec* r) {
> ....
> }
>
> So if we have an initial request that is HTML then redirect to captcha.shtml
> which contains SSI for header, footer etc.  There will also be a request for
> a captcha image using a fixed filename.  The fixup will detect this and send
> the request to a custom handler that will auto-generate the captcha image.
>  The problem I have is that I'm getting sub-requests and requests for the
> captcha image twice, see log below.  I assume that the original request for
> index.shtml and the request for captcha.shtml are being processed.  Using
> firebug I see that the captcha image that is displayed in the debug output
> isn't the one that gets displayed in the HTML so I can assume that the image
> is being sent twice.  I notice that the browser goes into a waiting state
> until the timeout expires.  Does anybody know what I'm doing wrong?  I've
> tried returning DECLINED or DONE after the ap_internal_redirect_handler call
> but still get the problem.  Any help appreciated.
>
> Best Regards,
> Martin.

Try putting

if (!ap_is_initial_req(req))
   return DECLINED;

at the beginning of your fixups callback.

Sorin

Reply via email to