Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    Apache2::DebugFilter 0.02

    Download button

    No screenshots available
    Downloads: 369  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Philip M. Gollucci | More programs
    Perl Artistic License / FREE
    March 20th, 2007, 05:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Apache2::DebugFilter description

    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 Handlers

    snoop_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_connection

    To snoop on response output, add:

    PerlOutputFilterHandler Apache2::DebugFilter::snoop_connection

    Both 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_connection

    On 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::input

    This 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 >

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    debug mod_perl | Apache2 filters | Perl module | module | debug | mod_perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM