/*--------------------------------------------------------------------*/
+void
+VRT_l_req_backend(struct sess *sp, struct backend *be)
+{
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ sp->backend = be;
+}
+
+struct backend *
+VRT_r_req_backend(struct sess *sp)
+{
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ return (sp->backend);
+}
+
+/*--------------------------------------------------------------------*/
+
#define VREQ(n1, n2) \
const char * \
VRT_r_req_##n1(struct sess *sp) \
/*
- * $Id: vcc_gen_fixed_token.tcl 638 2006-08-04 10:54:30Z phk $
+ * $Id: /mirror/varnish/trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 30751 2006-08-04T10:54:30.556113Z phk $
*
* NB: This file is machine generated, DO NOT EDIT!
*
/*
- * $Id: vcc_gen_obj.tcl 555 2006-07-22 08:02:47Z phk $
+ * $Id: /mirror/varnish/trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 30495 2006-07-22T08:02:47.026287Z phk $
*
* NB: This file is machine generated, DO NOT EDIT!
*
void VRT_l_client_ip(struct sess *, const unsigned char *);
const char * VRT_r_req_request(struct sess *);
void VRT_l_req_request(struct sess *, const char *);
+const char * VRT_r_req_host(struct sess *);
+void VRT_l_req_host(struct sess *, const char *);
const char * VRT_r_req_url(struct sess *);
void VRT_l_req_url(struct sess *, const char *);
const char * VRT_r_req_proto(struct sess *);
void VRT_l_req_proto(struct sess *, const char *);
+struct backend * VRT_r_req_backend(struct sess *);
+void VRT_l_req_backend(struct sess *, struct backend *);
double VRT_r_obj_valid(struct sess *);
void VRT_l_obj_valid(struct sess *, double);
double VRT_r_obj_cacheable(struct sess *);
void VRT_l_obj_cacheable(struct sess *, double);
-struct backend * VRT_r_obj_backend(struct sess *);
-void VRT_l_obj_backend(struct sess *, struct backend *);
double VRT_r_obj_ttl(struct sess *);
void VRT_l_obj_ttl(struct sess *, double);
const char * VRT_r_req_http_(struct sess *);
Fc(tl, 1, "%s\n", vp->rname);
}
+static void
+Cond_Backend(struct var *vp, struct tokenlist *tl)
+{
+
+ Fc(tl, 1, "%s\n", vp->rname);
+}
+
static void
Cond_2(struct tokenlist *tl)
{
case IP: L(tl, vcc_Cond_Ip(vp, tl)); break;
case STRING: L(tl, Cond_String(vp, tl)); break;
case TIME: L(tl, Cond_Int(vp, tl)); break;
- /* XXX backend == */
+ case BACKEND: L(tl, Cond_Backend(vp, tl)); break;
default:
vsb_printf(tl->sb,
"Variable '%s'"
if (tl->t->tok == '=') {
vcc_NextToken(tl);
AddRef(tl, tl->t, R_BACKEND);
- Fc(tl, 0, "= &VGC_backend_%.*s;\n", PF(tl->t));
+ Fc(tl, 0, "VGC_backend_%.*s", PF(tl->t));
vcc_NextToken(tl);
+ Fc(tl, 0, ");\n");
break;
}
vsb_printf(tl->sb, "Illegal assignment operator ");
set spobj {
{ client.ip IP }
{ req.request STRING }
+ { req.host STRING }
{ req.url STRING }
{ req.proto STRING }
+ { req.backend BACKEND }
{ obj.valid BOOL }
{ obj.cacheable BOOL }
- { obj.backend BACKEND }
{ obj.ttl TIME }
{ req.http. HEADER }
}
"VRT_r_req_request(sp)",
"VRT_l_req_request(sp, ",
},
+ { "req.host", STRING, 8,
+ "VRT_r_req_host(sp)",
+ "VRT_l_req_host(sp, ",
+ },
{ "req.url", STRING, 7,
"VRT_r_req_url(sp)",
"VRT_l_req_url(sp, ",
"VRT_r_req_proto(sp)",
"VRT_l_req_proto(sp, ",
},
+ { "req.backend", BACKEND, 11,
+ "VRT_r_req_backend(sp)",
+ "VRT_l_req_backend(sp, ",
+ },
{ "obj.valid", BOOL, 9,
"VRT_r_obj_valid(sp)",
"VRT_l_obj_valid(sp, ",
"VRT_r_obj_cacheable(sp)",
"VRT_l_obj_cacheable(sp, ",
},
- { "obj.backend", BACKEND, 11,
- "VRT_r_obj_backend(sp)",
- "VRT_l_obj_backend(sp, ",
- },
{ "obj.ttl", TIME, 7,
"VRT_r_obj_ttl(sp)",
"VRT_l_obj_ttl(sp, ",
"void VRT_l_client_ip(struct sess *, const unsigned char *);\n"
"const char * VRT_r_req_request(struct sess *);\n"
"void VRT_l_req_request(struct sess *, const char *);\n"
+ "const char * VRT_r_req_host(struct sess *);\n"
+ "void VRT_l_req_host(struct sess *, const char *);\n"
"const char * VRT_r_req_url(struct sess *);\n"
"void VRT_l_req_url(struct sess *, const char *);\n"
"const char * VRT_r_req_proto(struct sess *);\n"
"void VRT_l_req_proto(struct sess *, const char *);\n"
+ "struct backend * VRT_r_req_backend(struct sess *);\n"
+ "void VRT_l_req_backend(struct sess *, struct backend *);\n"
"double VRT_r_obj_valid(struct sess *);\n"
"void VRT_l_obj_valid(struct sess *, double);\n"
"double VRT_r_obj_cacheable(struct sess *);\n"
"void VRT_l_obj_cacheable(struct sess *, double);\n"
- "struct backend * VRT_r_obj_backend(struct sess *);\n"
- "void VRT_l_obj_backend(struct sess *, struct backend *);\n"
"double VRT_r_obj_ttl(struct sess *);\n"
"void VRT_l_obj_ttl(struct sess *, double);\n"
"const char * VRT_r_req_http_(struct sess *);\n"