r1173 - in branches/1.0: . bin/varnishd

des at projects.linpro.no des at projects.linpro.no
Wed Oct 18 16:27:00 CEST 2006


Author: des
Date: 2006-10-18 16:27:00 +0200 (Wed, 18 Oct 2006)
New Revision: 1173

Modified:
   branches/1.0/
   branches/1.0/bin/varnishd/cache_pass.c
   branches/1.0/bin/varnishd/cache_pipe.c
Log:
 r31765 at cat (orig r1134):  phk | 2006-10-02 16:08:49 +0200
 Also add missing Host: headers for Pass & Pipe
 



Property changes on: branches/1.0
___________________________________________________________________
Name: svk:merge
   - d4fa192b-c00b-0410-8231-f00ffab90ce4:/trunk/varnish-cache:1133
   + d4fa192b-c00b-0410-8231-f00ffab90ce4:/trunk/varnish-cache:1134

Modified: branches/1.0/bin/varnishd/cache_pass.c
===================================================================
--- branches/1.0/bin/varnishd/cache_pass.c	2006-10-18 14:26:59 UTC (rev 1172)
+++ branches/1.0/bin/varnishd/cache_pass.c	2006-10-18 14:27:00 UTC (rev 1173)
@@ -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: branches/1.0/bin/varnishd/cache_pipe.c
===================================================================
--- branches/1.0/bin/varnishd/cache_pipe.c	2006-10-18 14:26:59 UTC (rev 1172)
+++ branches/1.0/bin/varnishd/cache_pipe.c	2006-10-18 14:27:00 UTC (rev 1173)
@@ -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