ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
Apache and mod_perl question
by Francisco Zarabozo other posts by this author
Mar 29 2008 4:46PM messages near this date
Re: Unable to write to files using CGI | Re: Apache and mod_perl question
Hello All,

I might not be in the right mailing list for this question, but I think 
there a lot of people here that might be able to answer it. I apologize in 
advance if I'm wrong.

I'm using Apache 2.2 with mod_perl. I'm trying to write a module to analyze 
certain aspects of each request made to Apache (basically, specific 
malicious requests) and, if some conditions are met, give a special 
response. I'm not having trouble with that part. The problem I have is that 
I can't find the right way to let Apache continue with the normal request if 
the module has nothing to do after the request analysis.

I'm trying something like this:

-----------------------
In httpd.conf:
-----------------------
<Location /> 
    SetHandler perl-script
    PerlResponseHandler MyRequestAnalyzer
</Location> 


------------------------
In MyRequestAnalyzer.pm:
------------------------
package MyRequestAnalyzer;
use strict;
use warnings;
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const -compile =>  ':common';

sub handler {
    my $r = shift;
    if ( someConditionsMet($r) ) {
        # Here I give a special response, no problem here.
        return Apache2::Const::OK; # or else for that matter
    } else {
        # Here's my problem.
        # How do I make Apache continue with the normal request?
        # What kind of return value should I send to Apache?
    }
}

1;
-------------------------------

As I said, this is working great when the conditions I expect are met. The 
problem is that when they're not met, the module has nothing else to do and 
I need to let Apache continue with the request just as if it was never 
trapped by this module. I've tried a lot of different return values from 
Apache2 constants, but I can't find one that works yet.

I hope someone can give me some advice to accomplish this. Thank you very 
much in advance.

Cheers,

Paco Zarabozo






_______________________________________________
ActivePerl mailing list
ActivePerl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Francisco Zarabozo
Michael Gillis

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved