From 32fc6e3de2f1f448afc1cb8f4dafd2ff5542c232 Mon Sep 17 00:00:00 2001 From: bluhm Date: Mon, 5 Jan 2015 22:41:37 +0000 Subject: [PATCH] Fix relayd http regression tests. If http response is not ok, the response's content length may be an unexpected value as an error page is shown. --- regress/usr.sbin/relayd/funcs.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/regress/usr.sbin/relayd/funcs.pl b/regress/usr.sbin/relayd/funcs.pl index eef726435e9..98aee4390ab 100644 --- a/regress/usr.sbin/relayd/funcs.pl +++ b/regress/usr.sbin/relayd/funcs.pl @@ -1,4 +1,4 @@ -# $OpenBSD: funcs.pl,v 1.17 2014/08/18 22:58:19 bluhm Exp $ +# $OpenBSD: funcs.pl,v 1.18 2015/01/05 22:41:37 bluhm Exp $ # Copyright (c) 2010-2014 Alexander Bluhm # @@ -175,8 +175,12 @@ sub http_request { print STDERR "<<< $_\n"; last if /^$/; if (/^Content-Length: (.*)/) { - $1 == $len or die ref($self), - " bad content length $1"; + if ($self->{httpnok}) { + $len = $1; + } else { + $1 == $len or die ref($self), + " bad content length $1"; + } } if (/^Transfer-Encoding: chunked$/) { $chunked = 1; -- 2.20.1