From 58b1bddcdf86f386d79a082a5c296fe7dd68d25a Mon Sep 17 00:00:00 2001 From: des Date: Sat, 28 Jul 2007 11:41:35 +0000 Subject: [PATCH] Empty responses are not necessarily incorrect, even if Content-Length is non-zero. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1781 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-tools/regress/lib/Varnish/Test/Client.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/varnish-tools/regress/lib/Varnish/Test/Client.pm b/varnish-tools/regress/lib/Varnish/Test/Client.pm index 17d7dcb7..8f025d99 100644 --- a/varnish-tools/regress/lib/Varnish/Test/Client.pm +++ b/varnish-tools/regress/lib/Varnish/Test/Client.pm @@ -122,11 +122,19 @@ sub mux_input($$$$) { $$data = ''; $self->got_response($response); } + elsif ($data_length == 0) { + # We got a body-less response, which may or may not + # be correct; leave it to the test case to decide. + $self->log("No body received despite" . + " Content-Length $content_length"); + $$data = ''; + $self->got_response($response); + } elsif ($data_length < $content_length) { # We only received the first part of an HTTP message, # so break out of loop and wait for more. - $self->log(sprintf('Partial response. Bytes in body: %d received, %d expected, %d remaining', - $data_length, $content_length, $content_length - $data_length)); + $self->log("Partial body received" . + " ($data_length of $content_length bytes)"); last; } else { -- 2.39.5