diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-07-16 18:50:10 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-07-16 18:50:10 +0000 |
commit | ba579f2fa4cd3a08c7dd837c104572eb9642a9a4 (patch) | |
tree | fd795db695b3dbe12d2f3b3efd66d5bdfd3e5960 /regress | |
parent | b08adc39871ef8cd92bac9c3d364b6a7cf0ba66a (diff) |
Print the received percentage in client.log instead of dots.
This makes it nicer when waiting for large test files.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.sbin/httpd/tests/funcs.pl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/regress/usr.sbin/httpd/tests/funcs.pl b/regress/usr.sbin/httpd/tests/funcs.pl index f6503e72a11..2738d419179 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.3 2015/07/16 18:18:07 reyk Exp $ +# $OpenBSD: funcs.pl,v 1.4 2015/07/16 18:50:09 reyk Exp $ # Copyright (c) 2010-2015 Alexander Bluhm <bluhm@openbsd.org> # @@ -222,7 +222,8 @@ sub http_response { if ($chunked) { read_chunked($self); } else { - read_char($self, $vers eq "1.1" ? $len : undef) + #$len = $vers eq "1.1" ? $len : undef; + read_char($self, $len) if $method eq "GET"; } } @@ -289,10 +290,12 @@ sub read_char { print STDERR "Max\n"; } else { while ((my $r = sysread(STDIN, my $buf, POSIX::BUFSIZ))) { + my $pct; $_ = $buf; $len += $r; $ctx->add($_); - print STDERR "."; + $pct = ($len / $max) * 100.0; + printf(STDERR "%.2f%%\n", $pct); if (defined($max) && $len >= $max) { print STDERR "\nMax"; last; |