This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig292DBEE4F97516BBFA4DB397
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

J. Peng wrote:
> At what cases should we return a DECLINED or a OK from a handler?


Depends on the request phase you are running under, and ultimately, it's
dictated by apache [1]

> I saw the handler of PerlTransHandler returns a
> Apache2::Const:ECLINED but dont know why.


In a nutshell, there are 3 main type or return status:

OK

Means you kicked in to do what you were supposed to, and you succeded.

For instance, an PerlAuthHandler that checks username/password against
a database and finds a match, that's OK

DECLINED

Your handler kicked in, tried to do what it's interested in doing and
decided _not_ to do it, or had nothing to do, and usually, it means the
next handler down the handler stack will have a go at it.

For instance, a PerlOutputFilter might be registered, but only care to
filter text/html stuff. So it kicks in, looks at the content-type of the
current request, sees image/gif, so it returns DECLINED to indicate it's
passing its turn and somebody else should have a go at it.

ERRORS

There are many error codes one can return, mostly HTTP error codes, 404, =
501,
etc.

Usually, when a handler doesn't return OK/DECLINED, whatever it returns w=
ill
be treated as an error, and the request will abort and report that partic=
ular
error.

[1] http://perl.apache.org/docs/2.0/user...#Stacked_Hand=
lers

--=20
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/


--------------enig292DBEE4F97516BBFA4DB397
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHx3szyzKhB4jDpaURAi7CAKC/rcmD2W2WN3OMhBIEGMa7b6fp3gCaA+9U
74FsPy3VPBuJpWFXBknUWPY=
=W6Mq
-----END PGP SIGNATURE-----

--------------enig292DBEE4F97516BBFA4DB397--