r2609 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Mar 24 09:45:54 CET 2008


Author: phk
Date: 2008-03-24 09:45:54 +0100 (Mon, 24 Mar 2008)
New Revision: 2609

Modified:
   trunk/varnish-cache/bin/varnishd/cache_http.c
Log:
If the backend does not transmit a respose string, use the default
string for the status code as found in RFC2616.


Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2008-03-24 07:32:12 UTC (rev 2608)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2008-03-24 08:45:54 UTC (rev 2609)
@@ -451,6 +451,9 @@
 			if (vctyp(*p, C_CTL))
 				return (400);
 		hp->hd[h3].e = p;
+	} else {
+		hp->hd[h3].b = p;
+		hp->hd[h3].e = p;
 	}
 
 	/* Skip CRLF */
@@ -520,6 +523,13 @@
 		hp->status = 
 		    strtoul(hp->hd[HTTP_HDR_STATUS].b, NULL /* XXX */, 10);
 	}
+	if (!Tlen(hp->hd[HTTP_HDR_RESPONSE])) {
+		/* Backend didn't send a response string, use the standard */
+		hp->hd[HTTP_HDR_RESPONSE].b = 
+		    TRUST_ME(http_StatusMessage(hp->status));
+		hp->hd[HTTP_HDR_RESPONSE].e =
+		    strchr(hp->hd[HTTP_HDR_RESPONSE].b, '\0');
+	}
 	return (i);
 }
 




More information about the varnish-commit mailing list