r2089 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Oct 8 13:28:39 CEST 2007


Author: phk
Date: 2007-10-08 13:28:39 +0200 (Mon, 08 Oct 2007)
New Revision: 2089

Modified:
   trunk/varnish-cache/bin/varnishd/cache_http.c
Log:
Only attempt to decode status integer if we have a good separation.

Possibly ticket #164


Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2007-10-08 11:28:11 UTC (rev 2088)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2007-10-08 11:28:39 UTC (rev 2089)
@@ -503,7 +503,12 @@
 
 	if (i != 0 || memcmp(hp->hd[HTTP_HDR_PROTO].b, "HTTP/1.", 7))
 		WSLR(w, SLT_HttpGarbage, htc->fd, htc->rxbuf);
-	hp->status = strtoul(hp->hd[HTTP_HDR_STATUS].b, NULL /* XXX */, 10);
+	if (i != 0 && hp->status == 0) {
+		hp->status = i;
+	} else {
+		hp->status = 
+		    strtoul(hp->hd[HTTP_HDR_STATUS].b, NULL /* XXX */, 10);
+	}
 	return (i);
 }
 




More information about the varnish-commit mailing list