package Apache2::PrintFilterChain;

use strict;
use Apache2::Filter ();      # $f
use Apache2::FilterRec ();   # $f
use Apache2::RequestRec ();  # $r
use Apache2::Const -compile => qw(OK DECLINED);

sub handler {
  my $f   = shift;
  my $r   = $f->r;

  print STDERR "\n\nFilter Chain:\n";
  for( my $filter=$r->output_filters; $filter; $filter=$filter->next ) {
    print STDERR "  ", $filter->frec->name, "\n";
  }
  print STDERR "\n";
  $f->remove;

  return Apache2::Const::DECLINED;
}

1;
