httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rolf Banting" <>
Subject Re: httpd trunk - How to get info that ap_requires used to return
Date Mon, 07 Jan 2008 11:56:23 GMT
> My immediate aim is to test Isaac's UDP support patch with mod_perl - I
> want to make a case for apache as a viable alternative for our service
> platform and udp support is essential. If I can get the mod_perl  test suite
> to pass I increase the credibility of my proposal.

The mod_perl  tests that use ap_requires are quite simple - the Require
lines are retrieved via ap_requires and then the values compared against
data in the current request. Example:

In the conf:

Require user goo bar
Require group bar tar

In the test code:

# extract just the requirement entries
my %require =
map { my ($k, $v) = split /\s+/, $_->{requirement}, 2; ($k, $v||'') }
@{ $r->requires };
debug \%require;


return Apache2::Const::SERVER_ERROR unless $require{user} eq $users;
return Apache2::Const::SERVER_ERROR unless $require{group} eq $groups;

$require{user}   should be 'goo bar'
$require{group} should be 'bar tar'

I don't yet have much detailed knowledge of the httpd code - my naive
interpretation is that ap_requires returned a list of require_line structs
where the 'requirement' field is
everything after the 'Require' in the config line. If there was some
way to get a list of the Require statements in the conf file it would
be an easy matter to re-jig the test code.

I suppose I could parse the config file directly (e.g. with Config::General )
to get the Require lines - but I would prefer to use any in-built httpd
support if possible.

>From my naive perspective I'd offer  that per-directory queries for
information such as all Require statements are useful things to have.

I intend no criticism of the re-design.



View raw message