[master] 0be53bc Make this slightly more understandable for FlexeLint

Poul-Henning Kamp phk at FreeBSD.org
Tue Feb 23 10:51:13 CET 2016


commit 0be53bceafd8d57b803ef464e63690006a23633c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Feb 23 09:50:56 2016 +0000

    Make this slightly more understandable for FlexeLint

diff --git a/bin/varnishd/http1/cache_http1_proto.c b/bin/varnishd/http1/cache_http1_proto.c
index a13642f..7d1e9b1 100644
--- a/bin/varnishd/http1/cache_http1_proto.c
+++ b/bin/varnishd/http1/cache_http1_proto.c
@@ -364,13 +364,13 @@ HTTP1_DissectRequest(struct http_conn *htc, struct http *hp)
 
 	/* RFC2616, section 5.2, point 1 */
 	if (!strncasecmp(hp->hd[HTTP_HDR_URL].b, "http://", 7))
-		b = e = hp->hd[HTTP_HDR_URL].b + 7;
+		b = hp->hd[HTTP_HDR_URL].b + 7;
 	else if (FEATURE(FEATURE_HTTPS_SCHEME) &&
 	    !strncasecmp(hp->hd[HTTP_HDR_URL].b, "https://", 8))
-		b = e = hp->hd[HTTP_HDR_URL].b + 8;
+		b = hp->hd[HTTP_HDR_URL].b + 8;
 	if (b) {
-		while (*e != '/' && *e != '\0')
-			e++;
+		for (e = b; *e != '/' && *e != '\0'; e++)
+			continue;
 		if (*e == '/') {
 			http_Unset(hp, H_Host);
 			http_PrintfHeader(hp, "Host: %.*s", (int)(e - b), b);



More information about the varnish-commit mailing list