Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 14219 invoked by uid 6000); 18 May 1999 20:13:34 -0000 Received: (qmail 14127 invoked from network); 18 May 1999 20:13:29 -0000 Received: from atlrel1.hp.com (156.153.255.210) by taz.hyperreal.org with SMTP; 18 May 1999 20:13:29 -0000 Received: from hpias.cup.hp.com (bazavan@hpias.cup.hp.com [15.13.106.43]) by atlrel1.hp.com (8.8.6 (PHNE_17135)/8.8.5tis) with SMTP id QAA14934 for ; Tue, 18 May 1999 16:13:07 -0400 (EDT) Received: by hpias.cup.hp.com (1.38.193.4/15.5+IOS 3.20+cup+OMrelay) id AA05082; Tue, 18 May 1999 13:13:24 -0700 From: "Valentin Bazavan" Message-Id: <9905181313.ZM5080@hpias.cup.hp.com> Date: Tue, 18 May 1999 13:13:24 -0700 In-Reply-To: tvaughan@aventail.com "redirect in post-read phase" (May 17, 2:58pm) References: <7qpv3zl5nw.fsf@rehab.in.aventail.com> X-Mailer: Z-Mail (3.2.1 10oct95) To: new-httpd@apache.org Subject: Re: redirect in post-read phase Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org 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", ); 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. > > > -Tom > > -- > Tom Vaughan >-- End of excerpt from tvaughan@aventail.com