Apache-UploadMeter
view release on metacpan or search on metacpan
lib/Apache/UploadMeter.pm view on Meta::CPAN
return Apache2::Const::OK;
}
# Utility routines
sub __add_version_string {
my $r = shift;
$r->err_headers_out->add("X-Powered-By" => "Apache-UploadMeter/$VERSION");
}
sub upload_jit_handler($)
{
my $r=shift;
my $config = __lookup_config($r, "UploadHandler");
unless ($config) {
$r->log->warn("[Apache::UploadMeter] Couldn't find configuration data for url " . $r->uri);
return Apache2::Const::DECLINED;
}
$r->pnotes("Apache::UploadMeter::Config" => $config);
__add_version_string($r);
$r->add_input_filter(\&f_ufu_handler);
#$r->push_handlers("PerlHandler",\&r_handler);
#$r->handler("perl-script");
return u_handler($r);
}
sub meter_jit_handler($)
{
my $r=shift;
__add_version_string($r);
my $config = __lookup_config($r, "UploadMeter");
unless ($config) {
# Don't warn here; it shouldn't happen + we store all of our resources under this URI, so this will generate LOTs of false positives
return Apache2::Const::DECLINED;
}
$r->pnotes("Apache::UploadMeter::Config" => $config);
$r->handler("perl-script");
$r->push_handlers("PerlHandler",\&um_handler);
return Apache2::Const::DECLINED;
}
sub form_jit_handler($)
{
my $r=shift;
__add_version_string($r);
my $config = __lookup_config($r, "UploadForm");
unless ($config) {
$r->log->warn("[Apache::UploadMeter] Couldn't find configuration data for url " . $r->uri);
return Apache2::Const::DECLINED;
}
$r->pnotes("Apache::UploadMeter::Config" => $config);
$r->push_handlers("PerlFixupHandler",\&uf_handler);
( run in 0.662 second using v1.01-cache-2.11-cpan-65fba6d93b7 )