[master] e1d1b66 Add support for sending PROXY headers to backends.
Poul-Henning Kamp
phk at FreeBSD.org
Thu Apr 7 10:51:04 CEST 2016
commit e1d1b66e2333e0fa2cab8093dc1fb8614d7e01bf
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Apr 7 08:49:26 2016 +0000
Add support for sending PROXY headers to backends.
diff --git a/lib/libvcc/vcc_backend.c b/lib/libvcc/vcc_backend.c
index d544ffd..a76e95a 100644
--- a/lib/libvcc/vcc_backend.c
+++ b/lib/libvcc/vcc_backend.c
@@ -288,6 +288,7 @@ static void
vcc_ParseHostDef(struct vcc *tl, const struct token *t_be, const char *vgcname)
{
struct token *t_field;
+ struct token *t_val;
struct token *t_host = NULL;
struct token *t_port = NULL;
struct token *t_hosthdr = NULL;
@@ -307,6 +308,7 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be, const char *vgcname)
"?between_bytes_timeout",
"?probe",
"?max_connections",
+ "?proxy_header",
NULL);
SkipToken(tl, '{');
@@ -379,6 +381,18 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be, const char *vgcname)
ERRCHK(tl);
SkipToken(tl, ';');
Fb(tl, 0, "\t.max_connections = %u,\n", u);
+ } else if (vcc_IdIs(t_field, "proxy_header")) {
+ t_val = tl->t;
+ u = vcc_UintVal(tl);
+ ERRCHK(tl);
+ if (u != 1 && u != 2) {
+ VSB_printf(tl->sb,
+ ".proxy_header must be 1 or 2\n");
+ vcc_ErrWhere(tl, t_val);
+ return;
+ }
+ SkipToken(tl, ';');
+ Fb(tl, 0, "\t.proxy_header = %u,\n", u);
} else if (vcc_IdIs(t_field, "probe") && tl->t->tok == '{') {
vcc_ParseProbeSpec(tl, NULL, &p);
Fb(tl, 0, "\t.probe = &%s,\n", p);
More information about the varnish-commit
mailing list