]> err.no Git - varnish/commitdiff
Empty responses are not necessarily incorrect, even if Content-Length is
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 28 Jul 2007 11:41:35 +0000 (11:41 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 28 Jul 2007 11:41:35 +0000 (11:41 +0000)
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

index 17d7dcb73fc9ce74d2e9bcbb411f1572279b5cac..8f025d998e9e61060ef6d3d41c48b3d66fe6ca6d 100644 (file)
@@ -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 {