httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Valentin Bazavan" <baza...@hpias.cup.hp.com>
Subject Re: redirect in post-read phase
Date Tue, 18 May 1999 20:13:24 GMT
I had a similar need in a module I wrote some time ago, and I couldn't make
redirection to work from the post-read callback. I used a workaround instead.
Namely, I created a redirect handler, and in the post-read callback I set the
handler member of the request_rec structure to point to this handler.
It works pretty well, if you don't mind the extra step. E.g.:

static int hpac_redirect( request_rec *r )
{
    .
    .
    r->status = REDIRECT;
    ap_table_set( r->headers_out, "Location", <some URI> );
    return REDIRECT;
}

handler_rec hpac_handlers[ ] =
{
    { "hpac-redirect", hpac_redirect },
    .
    .
    { NULL }
};

static int control_hpac( request_rec *r )
{
    .
    .
    r->handler = "hpac-redirect";
    ap_table_setn( r->notes, "HPAC", "redirected"); /* for logging */
    return OK;

}

> would cause NOTHING to be sent to the client? Can a redirect be done in the
> post-read phase? I haven't traced this down all the way, but it appears
> that apache is going through all the right motions to send the header out,
> it's just that nothing is being write()'d.
> </X-POST>
>
> -Tom
>
> --
> Tom Vaughan <tvaughan at aventail dot com>
>-- End of excerpt from tvaughan@aventail.com



Mime
View raw message