Geoffrey Young wrote: > > > what is wrong with DONE? DONE immediatly closes the client > > connection > > > and starts the logging phase. if you have sent the content already > > > then there is nothing to worry about. the call to send_http_header > > > will pick up on the any status you set previously or use the default > > > HTTP_OK set at the start of the request. > > > > Isn't DONE ignored like OK and DECLINED? "Writing Apache Modules > > w. P.a.C." says: > > > > "..Each handler will be called in turn in the order in which it was > > declared. The exception to this rule is if one of the handlers in the > > series returns an error code (anything other than OK, DECLINED, or > > DONE)..." > > ok, I think that paragraph can be read a few ways. > > pretty much anything other than OK, DECLINED, or DONE is treated as an error > and starts the error processing cycle. even things like REDIRECT. that's > what I think the parenthetical was talking about. now, that aside, DONE has > special meaning to Apache, namely ending the request and moving to the > logging phase. Looks like I was wrong about it closing the connection, > though - I thought I had both read and tested that, but I can't see in the > code where Apache overrides the current keepalive settings and in my tests > the connection was left open. > > the current implementation in perl_call_handler has exceptions for != OK, > then further processing for SERVER_ERROR and DECLINED. DONE appears to fall > through, which would appear to make it behave the way I described. > > however, the real proof is in testing, which for me shows exactly what I > expected - DONE terminates the chain and returns 200. try it yourself :) > > --Geoff
OK thanks for all the help. I read the eagle book properly the second time and found the description of DONE (so this thread is getting a little embarrasing!). I'm using chained handlers now with $r->pnotes to coordinate all handler responses (Along with Apache::Filter to pass data along the chain) e.g. if the first handler returnes DECLINED, the rest will also because of a flag set with pnotes. Someone else suggested pnotes earlier in the thread. thanks again.