Apache2::DebugFilter

Apache2::DebugFilter is a Perl module to debug mod_perl and native Apache2 filters.
Download

Apache2::DebugFilter Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Philip M. Gollucci
  • Publisher web site:
  • http://search.cpan.org/~pgollucci/mod_perl-2.0.3/docs/api/ModPerl/MM.pod

Apache2::DebugFilter Tags


Apache2::DebugFilter Description

Apache2::DebugFilter is a Perl module to debug mod_perl and native Apache2 filters. Apache2::DebugFilter is a Perl module to debug mod_perl and native Apache2 filters.Synopsis # httpd.conf # ---------- PerlModule Apache2::DebugFilter # Connection snooping (everything) PerlInputFilterHandler Apache2::DebugFilter::snoop_connection PerlOutputFilterHandler Apache2::DebugFilter::snoop_connection # HTTP Request snooping (only HTTP request body) < Location /foo > PerlInputFilterHandler Apache2::DebugFilter::snoop_request PerlOutputFilterHandler Apache2::DebugFilter::snoop_request < /Location > # in handlers #------------ use Apache2::DebugFilter; # convert bb to an array of bucket_type => data pairs my $ra_data = Apache2::DebugFilter::bb_dump($bb); while (my($btype, $data) = splice @data, 0, 2) { print "$btype => $datan"; } # dump pretty formatted bb's content to a filehandle of your choice bb_dump($bb, *STDERR);Filter Handlerssnoop_connection()The snoop_connection() filter handler snoops on request and response data flow. For example if the HTTP protocol request is filtered it'll show both the headers and the body of the request and response.Notice that in order to see request's input body, the response handler must consume it.The same handler is used for input and output filtering. It internally figures out what kind of stream it's working on.To configure the input snooper, add to the top level server or virtual host configuration in httpd.conf: PerlInputFilterHandler Apache2::DebugFilter::snoop_connectionTo snoop on response output, add: PerlOutputFilterHandler Apache2::DebugFilter::snoop_connectionBoth can be configured at the same time.If you want to snoop on what an output filter MyApache2::Filter::output does, put the snooper filter after it: PerlOutputFilterHandler MyApache2::Filter::output PerlOutputFilterHandler Apache2::DebugFilter::snoop_connectionOn the contrary, to snoop on what an input filter MyApache2::Filter::input does, put the snooper filter before it: PerlInputFilterHandler Apache2::DebugFilter::snoop_connection PerlInputFilterHandler MyApache2::Filter::inputThis is because snoop_connection is going to be invoked first and immediately call MyApache2::Filter::input the input filter for data. Only when the latter returns, snoop_connection will do its work.snoop_request()The snoop_request() filter handler snoops only on HTTP request and response bodies. Otherwise it's similar to snoop_connection(). Only normally it's configured for a specific < Location >. For example: < Location /foo > PerlInputFilterHandler Apache2::DebugFilter::snoop_request PerlOutputFilterHandler Apache2::DebugFilter::snoop_request < /Location > Requirements: · Perl


Apache2::DebugFilter Related Software