summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/httpd
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2016-05-03 19:13:05 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2016-05-03 19:13:05 +0000
commit038c1503d1e9350cd20c8a09443719bfcda1f66d (patch)
treeb37153a44bcc30eaade4a5eab89a7485eca8d6e8 /regress/usr.sbin/httpd
parentad5a22515d4bb07e1a70cfd730aa53c327daebcb (diff)
Fix some Perl statements perlcritic was bitching about: Variable
declared in conditional statement.
Diffstat (limited to 'regress/usr.sbin/httpd')
-rw-r--r--regress/usr.sbin/httpd/tests/Proc.pm5
-rw-r--r--regress/usr.sbin/httpd/tests/funcs.pl8
-rw-r--r--regress/usr.sbin/httpd/tests/httpd.pl7
3 files changed, 12 insertions, 8 deletions
diff --git a/regress/usr.sbin/httpd/tests/Proc.pm b/regress/usr.sbin/httpd/tests/Proc.pm
index 8f46012b23d..a98cc176d79 100644
--- a/regress/usr.sbin/httpd/tests/Proc.pm
+++ b/regress/usr.sbin/httpd/tests/Proc.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: Proc.pm,v 1.1 2015/07/16 16:35:57 reyk Exp $
+# $OpenBSD: Proc.pm,v 1.2 2016/05/03 19:13:04 bluhm Exp $
# Copyright (c) 2010-2014 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -147,7 +147,8 @@ sub loggrep {
my $self = shift;
my($regex, $timeout) = @_;
- my $end = time() + $timeout if $timeout;
+ my $end;
+ $end = time() + $timeout if $timeout;
do {
my($kid, $status, $code) = $self->wait(WNOHANG);
diff --git a/regress/usr.sbin/httpd/tests/funcs.pl b/regress/usr.sbin/httpd/tests/funcs.pl
index 9a0db7e4299..beda09ac5f6 100644
--- a/regress/usr.sbin/httpd/tests/funcs.pl
+++ b/regress/usr.sbin/httpd/tests/funcs.pl
@@ -1,4 +1,4 @@
-# $OpenBSD: funcs.pl,v 1.5 2015/07/18 19:17:13 benno Exp $
+# $OpenBSD: funcs.pl,v 1.6 2016/05/03 19:13:04 bluhm Exp $
# Copyright (c) 2010-2015 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -425,7 +425,8 @@ sub check_len {
$args{len} ||= 512 unless $args{lengths};
- my @clen = $c->loggrep(qr/^LEN: /) or die "no client len"
+ my @clen;
+ @clen = $c->loggrep(qr/^LEN: /) or die "no client len"
unless $args{client}{nocheck};
# !@clen
# or die "client: @clen", "len mismatch";
@@ -445,7 +446,8 @@ sub check_len {
sub check_md5 {
my ($c, $r, %args) = @_;
- my @cmd5 = $c->loggrep(qr/^MD5: /) unless $args{client}{nocheck};
+ my @cmd5;
+ @cmd5 = $c->loggrep(qr/^MD5: /) unless $args{client}{nocheck};
my @md5 = ref($args{md5}) eq 'ARRAY' ? @{$args{md5}} : $args{md5} || ()
or return;
foreach my $md5 (@md5) {
diff --git a/regress/usr.sbin/httpd/tests/httpd.pl b/regress/usr.sbin/httpd/tests/httpd.pl
index 481a5871136..6ca2d83d88f 100644
--- a/regress/usr.sbin/httpd/tests/httpd.pl
+++ b/regress/usr.sbin/httpd/tests/httpd.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $OpenBSD: httpd.pl,v 1.1 2015/07/16 16:35:57 reyk Exp $
+# $OpenBSD: httpd.pl,v 1.2 2016/05/03 19:13:04 bluhm Exp $
# Copyright (c) 2010-2015 Alexander Bluhm <bluhm@openbsd.org>
# Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -41,7 +41,8 @@ if (@ARGV and -f $ARGV[-1]) {
my $redo = $args{lengths} && @{$args{lengths}};
$redo = 0 if $args{client}{http_vers}; # run only one persistent connection
my($sport, $rport) = find_ports(num => 2);
-my $d = Httpd->new(
+my($d, $c);
+$d = Httpd->new(
chroot => $ARGV[0],
listendomain => AF_INET,
listenaddr => "127.0.0.1",
@@ -52,7 +53,7 @@ my $d = Httpd->new(
%{$args{httpd}},
testfile => $testfile,
);
-my $c = Client->new(
+$c = Client->new(
chroot => $ARGV[0],
func => \&http_client,
connectdomain => AF_INET,