r1781 - trunk/varnish-tools/regress/lib/Varnish/Test

des at projects.linpro.no des at projects.linpro.no
Sat Jul 28 13:41:35 CEST 2007


Author: des
Date: 2007-07-28 13:41:35 +0200 (Sat, 28 Jul 2007)
New Revision: 1781

Modified:
   trunk/varnish-tools/regress/lib/Varnish/Test/Client.pm
Log:
Empty responses are not necessarily incorrect, even if Content-Length is
non-zero.


Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Client.pm
===================================================================
--- trunk/varnish-tools/regress/lib/Varnish/Test/Client.pm	2007-07-28 10:03:29 UTC (rev 1780)
+++ trunk/varnish-tools/regress/lib/Varnish/Test/Client.pm	2007-07-28 11:41:35 UTC (rev 1781)
@@ -122,11 +122,19 @@
 		$$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 {




More information about the varnish-commit mailing list