[master] 11ae787 Reset bodylen when we receive a new http message.

Poul-Henning Kamp phk at FreeBSD.org
Tue Sep 15 15:02:15 CEST 2015


commit 11ae78743af3b6ccd07665700606c5bfc401176e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Sep 15 12:49:39 2015 +0000

    Reset bodylen when we receive a new http message.

diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index ec1350a..64ecef5 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -490,7 +490,7 @@ http_swallow_body(struct http *hp, char * const *hh, int body)
 		(void)http_rxchar(hp, l, 0);
 		vtc_dump(hp->vl, 4, "body", hp->body, l);
 		hp->bodyl = l;
-		sprintf(hp->bodylen, "%d", l);
+		bprintf(hp->bodylen, "%d", l);
 		return;
 	}
 	if (body) {
@@ -517,6 +517,7 @@ http_rxhdr(struct http *hp)
 	CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
 	hp->prxbuf = 0;
 	hp->body = NULL;
+	bprintf(hp->bodylen, "%s", "<undef>");
 	while (1) {
 		(void)http_rxchar(hp, 1, 0);
 		p = hp->rxbuf + hp->prxbuf - 1;



More information about the varnish-commit mailing list