[master] 556951d Tell it if we timed out the testcase and killed the child.

Poul-Henning Kamp phk at FreeBSD.org
Thu Jan 19 18:30:06 CET 2017


commit 556951d2f811b3398e1f85fd44432f654292f390
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Jan 19 17:22:00 2017 +0000

    Tell it if we timed out the testcase and killed the child.
    
    Fail out of http reception if the socket fails

diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index a25b235..7c0d36b 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -625,7 +625,7 @@ http_swallow_body(struct http *hp, char * const *hh, int body)
 	ll = 0;
 	p = http_find_header(hh, "transfer-encoding");
 	if (p != NULL && !strcasecmp(p, "chunked")) {
-		while (http_rxchunk(hp) != 0)
+		while (http_rxchunk(hp) > 0)
 			continue;
 		vtc_dump(hp->vl, 4, "body", hp->body, ll);
 		ll = hp->rxbuf + hp->prxbuf - hp->body;
@@ -636,7 +636,8 @@ http_swallow_body(struct http *hp, char * const *hh, int body)
 	p = http_find_header(hh, "content-length");
 	if (p != NULL) {
 		l = strtoul(p, NULL, 10);
-		(void)http_rxchar(hp, l, 0);
+		if (http_rxchar(hp, l, 0) < 0)
+			return;
 		vtc_dump(hp->vl, 4, "body", hp->body, l);
 		hp->bodyl = l;
 		bprintf(hp->bodylen, "%d", l);
@@ -645,6 +646,8 @@ http_swallow_body(struct http *hp, char * const *hh, int body)
 	if (body) {
 		do  {
 			i = http_rxchar(hp, 1, 1);
+			if (i < 0)
+				return;
 			ll += i;
 		} while (i > 0);
 		vtc_dump(hp->vl, 4, "rxeof", hp->body, ll);



More information about the varnish-commit mailing list