r1121 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Sat Sep 23 21:30:29 CEST 2006
Author: phk
Date: 2006-09-23 21:30:29 +0200 (Sat, 23 Sep 2006)
New Revision: 1121
Modified:
trunk/varnish-cache/bin/varnishd/cache_fetch.c
trunk/varnish-cache/bin/varnishd/cache_pass.c
trunk/varnish-cache/bin/varnishd/cache_pipe.c
Log:
Always send X-Forwarded-for: header to backend.
Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2006-09-23 16:45:26 UTC (rev 1120)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2006-09-23 19:30:29 UTC (rev 1121)
@@ -341,6 +341,8 @@
http_GetReq(w, vc->fd, vc->http, sp->http);
http_FilterHeader(w, vc->fd, vc->http, sp->http, HTTPH_R_FETCH);
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);
Modified: trunk/varnish-cache/bin/varnishd/cache_pass.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pass.c 2006-09-23 16:45:26 UTC (rev 1120)
+++ trunk/varnish-cache/bin/varnishd/cache_pass.c 2006-09-23 19:30:29 UTC (rev 1121)
@@ -187,6 +187,8 @@
http_CopyResp(sp->wrk, sp->fd, sp->http, vc->http);
http_FilterHeader(sp->wrk, sp->fd, sp->http, vc->http, HTTPH_A_PASS);
http_PrintfHeader(sp->wrk, sp->fd, sp->http, "X-Varnish: %u", sp->xid);
+ http_PrintfHeader(sp->wrk, sp->fd, sp->http,
+ "X-Forwarded-for: %s", sp->addr);
/* XXX */
if (http_HdrIs(vc->http, H_Transfer_Encoding, "chunked"))
http_PrintfHeader(sp->wrk, sp->fd, sp->http, "Transfer-Encoding: chunked");
Modified: trunk/varnish-cache/bin/varnishd/cache_pipe.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pipe.c 2006-09-23 16:45:26 UTC (rev 1120)
+++ trunk/varnish-cache/bin/varnishd/cache_pipe.c 2006-09-23 19:30:29 UTC (rev 1121)
@@ -88,6 +88,8 @@
http_CopyReq(w, vc->fd, vc->http, sp->http);
http_FilterHeader(w, vc->fd, vc->http, sp->http, HTTPH_R_PIPE);
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);
WRK_Reset(w, &vc->fd);
http_Write(w, vc->http, 0);
More information about the varnish-commit
mailing list