Header check config/logical-inversion fix

Jost Krieger pointed out that the documentation for the header check called
for a config_headers, but the code actually implemented scan_headers.  Updated
to accept either.  Also the condition for actually checking/skipping the
headers was inverted.

Also whitespace fixes.
This commit is contained in:
Devin Carraway 2010-02-19 00:04:53 -08:00 committed by Robert
parent 660ed14823
commit 73eb9012bd

View File

@ -143,7 +143,9 @@ sub init {
$self->{action} = $args{action} || 'add-header'; $self->{action} = $args{action} || 'add-header';
$self->{timeout} = $args{timeout} || 30; $self->{timeout} = $args{timeout} || 30;
$self->{check_headers} = $args{'check-headers'}; # scan-headers was the originally documented name for this option, while
# check-headers actually implements it, so tolerate both.
$self->{check_headers} = $args{'check-headers'} || $args{'scan-headers'};
$args{mask} ||= 0x00ffffff; $args{mask} ||= 0x00ffffff;
$self->{mask} = 0; $self->{mask} = 0;
@ -270,7 +272,9 @@ sub lookup_start {
my @qp_continuations; my @qp_continuations;
$transaction->body_resetpos; $transaction->body_resetpos;
while ($self->{check_headers} and $l = $transaction->body_getline) { # if we're not looking for URIs in the headers, read past that point
# before starting to actually look for any
while (!$self->{check_headers} and $l = $transaction->body_getline) {
chomp $l; chomp $l;
last if !$l; last if !$l;
} }