r3316 - in branches/2.0/varnish-cache/bin: varnishd varnishtest/tests

tfheen at projects.linpro.no tfheen at projects.linpro.no
Fri Oct 17 13:04:12 CEST 2008


Author: tfheen
Date: 2008-10-17 13:04:12 +0200 (Fri, 17 Oct 2008)
New Revision: 3316

Added:
   branches/2.0/varnish-cache/bin/varnishtest/tests/r00354.vtc
Modified:
   branches/2.0/varnish-cache/bin/varnishd/cache_center.c
   branches/2.0/varnish-cache/bin/varnishd/cache_http.c
Log:
Merge r3315 from trunk

Modified: branches/2.0/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_center.c	2008-10-17 09:03:21 UTC (rev 3315)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_center.c	2008-10-17 11:04:12 UTC (rev 3316)
@@ -308,6 +308,7 @@
 
 	/* We always close when we take this path */
 	sp->doclose = "error";
+	sp->wantbody = 1;
 
 	w = sp->wrk;
 	if (sp->obj == NULL) {

Modified: branches/2.0/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_http.c	2008-10-17 09:03:21 UTC (rev 3315)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_http.c	2008-10-17 11:04:12 UTC (rev 3316)
@@ -496,16 +496,17 @@
 
 	i = http_splitline(sp->wrk, sp->fd, hp, htc,
 	    HTTP_HDR_REQ, HTTP_HDR_URL, HTTP_HDR_PROTO);
-	hp->protover = 0.9;
+	if (i != 0) {
+		WSPR(sp, SLT_HttpGarbage, htc->rxbuf);
+		return (i);
+	}
+
 	if (!strcmp(hp->hd[HTTP_HDR_PROTO].b, "HTTP/1.0"))
 		hp->protover = 1.0;
 	else if (!strcmp(hp->hd[HTTP_HDR_PROTO].b, "HTTP/1.1"))
 		hp->protover = 1.1;
 	else
 		hp->protover = 0.9;
-
-	if (i != 0)
-		WSPR(sp, SLT_HttpGarbage, htc->rxbuf);
 	return (i);
 }
 

Copied: branches/2.0/varnish-cache/bin/varnishtest/tests/r00354.vtc (from rev 3315, trunk/varnish-cache/bin/varnishtest/tests/r00354.vtc)
===================================================================
--- branches/2.0/varnish-cache/bin/varnishtest/tests/r00354.vtc	                        (rev 0)
+++ branches/2.0/varnish-cache/bin/varnishtest/tests/r00354.vtc	2008-10-17 11:04:12 UTC (rev 3316)
@@ -0,0 +1,16 @@
+# $Id$
+
+test "#354 Segfault in strcmp in http_DissectRequest()"
+
+server s1 {
+	rxreq
+	txresp
+}
+
+varnish v1 -vcl+backend {} -start
+
+client c1 {
+	send "FOO\r\n\r\n"
+	rxresp
+	expect resp.status == 400
+} -run




More information about the varnish-commit mailing list