r1134 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Oct 2 16:08:49 CEST 2006


Author: phk
Date: 2006-10-02 16:08:49 +0200 (Mon, 02 Oct 2006)
New Revision: 1134

Modified:
   trunk/varnish-cache/bin/varnishd/cache_pass.c
   trunk/varnish-cache/bin/varnishd/cache_pipe.c
Log:
Also add missing Host: headers for Pass & Pipe


Modified: trunk/varnish-cache/bin/varnishd/cache_pass.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-09-29 18:37:02 UTC (rev 1133)
+++ trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-10-02 14:08:49 UTC (rev 1134)
@@ -226,6 +226,7 @@
 	int i;
 	struct vbe_conn *vc;
 	struct worker *w;
+	char *b;
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 	CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);
@@ -238,6 +239,10 @@
 	http_CopyReq(w, vc->fd, vc->http, sp->http);
 	http_FilterHeader(w, vc->fd, vc->http, sp->http, HTTPH_R_PASS);
 	http_PrintfHeader(w, vc->fd, vc->http, "X-Varnish: %u", sp->xid);
+	if (!http_GetHdr(vc->http, H_Host, &b)) {
+		http_PrintfHeader(w, vc->fd, vc->http, "Host: %s",
+		    sp->backend->hostname);
+	}
 	WRK_Reset(w, &vc->fd);
 	http_Write(w, vc->http, 0);
 	i = WRK_Flush(w);

Modified: trunk/varnish-cache/bin/varnishd/cache_pipe.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pipe.c	2006-09-29 18:37:02 UTC (rev 1133)
+++ trunk/varnish-cache/bin/varnishd/cache_pipe.c	2006-10-02 14:08:49 UTC (rev 1134)
@@ -90,6 +90,10 @@
 	http_PrintfHeader(w, vc->fd, vc->http, "X-Varnish: %u", sp->xid);
 	http_PrintfHeader(w, vc->fd, vc->http,
 	    "X-Forwarded-for: %s", sp->addr);
+	if (!http_GetHdr(vc->http, H_Host, &b)) {
+		http_PrintfHeader(w, vc->fd, vc->http, "Host: %s",
+		    sp->backend->hostname);
+	}
 	WRK_Reset(w, &vc->fd);
 	http_Write(w, vc->http, 0);
 




More information about the varnish-commit mailing list