From 9617540db634dc81eab7cd9a4fa9f6645576ec97 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 4 Feb 2008 09:26:36 +0000 Subject: [PATCH] GC support code for the old backend specification code. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2420 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/include/vrt_obj.h | 4 --- varnish-cache/lib/libvcl/vcc_compile.c | 5 ---- varnish-cache/lib/libvcl/vcc_compile.h | 6 +--- varnish-cache/lib/libvcl/vcc_fixed_token.c | 8 ++---- varnish-cache/lib/libvcl/vcc_gen_obj.tcl | 13 --------- varnish-cache/lib/libvcl/vcc_obj.c | 32 ---------------------- 6 files changed, 3 insertions(+), 65 deletions(-) diff --git a/varnish-cache/include/vrt_obj.h b/varnish-cache/include/vrt_obj.h index 6c7cef88..d3aa010b 100644 --- a/varnish-cache/include/vrt_obj.h +++ b/varnish-cache/include/vrt_obj.h @@ -6,10 +6,6 @@ * Edit vcc_gen_obj.tcl instead */ -void VRT_l_backend_host(struct backend *, const char *); -void VRT_l_backend_port(struct backend *, const char *); -void VRT_l_backend_dnsttl(struct backend *, double); -void VRT_l_backend_set(struct backend *, struct vrt_backend_entry *); struct sockaddr * VRT_r_client_ip(const struct sess *); struct sockaddr * VRT_r_server_ip(struct sess *); const char * VRT_r_req_request(const struct sess *); diff --git a/varnish-cache/lib/libvcl/vcc_compile.c b/varnish-cache/lib/libvcl/vcc_compile.c index 46f5b15f..cf34db36 100644 --- a/varnish-cache/lib/libvcl/vcc_compile.c +++ b/varnish-cache/lib/libvcl/vcc_compile.c @@ -692,15 +692,10 @@ VCC_CompileFile(struct vsb *sb, const char *fn, int fd) void VCC_InitCompile(const char *default_vcl) { - struct var *v; vcc_default_vcl_b = default_vcl; vcc_default_vcl_e = strchr(default_vcl, '\0'); assert(vcc_default_vcl_e != NULL); vcl_init_tnames(); - for (v = vcc_vars; v->name != NULL; v++) - v->len = strlen(v->name); - for (v = vcc_be_vars; v->name != NULL; v++) - v->len = strlen(v->name); } diff --git a/varnish-cache/lib/libvcl/vcc_compile.h b/varnish-cache/lib/libvcl/vcc_compile.h index a7e848e2..f638c3e0 100644 --- a/varnish-cache/lib/libvcl/vcc_compile.h +++ b/varnish-cache/lib/libvcl/vcc_compile.h @@ -106,11 +106,8 @@ enum var_type { RTIME, STRING, IP, - HOSTNAME, - PORTNAME, HASH, - HEADER, - SET + HEADER }; enum var_access { @@ -177,7 +174,6 @@ void TlFree(struct tokenlist *tl, void *p); void *TlAlloc(struct tokenlist *tl, unsigned len); /* vcc_obj.c */ -extern struct var vcc_be_vars[]; extern struct var vcc_vars[]; /* vcc_parse.c */ diff --git a/varnish-cache/lib/libvcl/vcc_fixed_token.c b/varnish-cache/lib/libvcl/vcc_fixed_token.c index 41af0480..0b82433b 100644 --- a/varnish-cache/lib/libvcl/vcc_fixed_token.c +++ b/varnish-cache/lib/libvcl/vcc_fixed_token.c @@ -505,10 +505,6 @@ vcl_output_lang_h(struct vsb *sb) vsb_cat(sb, " * Edit vcc_gen_obj.tcl instead\n"); vsb_cat(sb, " */\n"); vsb_cat(sb, "\n"); - vsb_cat(sb, "void VRT_l_backend_host(struct backend *, const char *);\n"); - vsb_cat(sb, "void VRT_l_backend_port(struct backend *, const char *);\n"); - vsb_cat(sb, "void VRT_l_backend_dnsttl(struct backend *, double);\n"); - vsb_cat(sb, "void VRT_l_backend_set(struct backend *, struct vrt_backend_entry *);\n"); vsb_cat(sb, "struct sockaddr * VRT_r_client_ip(const struct sess *);\n"); vsb_cat(sb, "struct sockaddr * VRT_r_server_ip(struct sess *);\n"); vsb_cat(sb, "const char * VRT_r_req_request(const struct sess *);\n"); @@ -521,8 +517,8 @@ vcl_output_lang_h(struct vsb *sb) vsb_cat(sb, "struct backend * VRT_r_req_backend(struct sess *);\n"); vsb_cat(sb, "void VRT_l_req_backend(struct sess *, struct backend *);\n"); vsb_cat(sb, "int VRT_r_req_restarts(const struct sess *);\n"); - vsb_cat(sb, "double VRT_r_req_grace(const struct sess *);\n"); - vsb_cat(sb, "void VRT_l_req_grace(const struct sess *, double);\n"); + vsb_cat(sb, "double VRT_r_req_grace(struct sess *);\n"); + vsb_cat(sb, "void VRT_l_req_grace(struct sess *, double);\n"); vsb_cat(sb, "const char * VRT_r_bereq_request(const struct sess *);\n"); vsb_cat(sb, "void VRT_l_bereq_request(const struct sess *, const char *, ...);\n"); vsb_cat(sb, "const char * VRT_r_bereq_url(const struct sess *);\n"); diff --git a/varnish-cache/lib/libvcl/vcc_gen_obj.tcl b/varnish-cache/lib/libvcl/vcc_gen_obj.tcl index 33e2922c..3c7a9c25 100755 --- a/varnish-cache/lib/libvcl/vcc_gen_obj.tcl +++ b/varnish-cache/lib/libvcl/vcc_gen_obj.tcl @@ -30,13 +30,6 @@ # Generate various .c and .h files for the VCL compiler and the interfaces # for it. -# Objects available in backends -set beobj { - { backend.host WO HOSTNAME {} "struct backend *"} - { backend.port WO PORTNAME {} "struct backend *"} - { backend.dnsttl WO TIME {} "struct backend *"} - { backend.set WO SET {} "struct backend *"} -} # Variables available in sessions # Comments are stripped from #...\n @@ -316,12 +309,6 @@ puts $fo "#include " puts $fo "#include \"vcc_compile.h\"" puts $fo "" -puts $fo "struct var vcc_be_vars\[\] = {" -vars $beobj "backend" -puts $fo "};" - -puts $fo "" - puts $fo "struct var vcc_vars\[\] = {" vars $spobj "sp" puts $fo "};" diff --git a/varnish-cache/lib/libvcl/vcc_obj.c b/varnish-cache/lib/libvcl/vcc_obj.c index 9bdca4db..d4df8b27 100644 --- a/varnish-cache/lib/libvcl/vcc_obj.c +++ b/varnish-cache/lib/libvcl/vcc_obj.c @@ -9,38 +9,6 @@ #include #include "vcc_compile.h" -struct var vcc_be_vars[] = { - { "backend.host", HOSTNAME, 12, - NULL, - "VRT_l_backend_host(backend, ", - V_WO, - 0, - 0 - }, - { "backend.port", PORTNAME, 12, - NULL, - "VRT_l_backend_port(backend, ", - V_WO, - 0, - 0 - }, - { "backend.dnsttl", TIME, 14, - NULL, - "VRT_l_backend_dnsttl(backend, ", - V_WO, - 0, - 0 - }, - { "backend.set", SET, 11, - NULL, - "VRT_l_backend_set(backend, ", - V_WO, - 0, - 0 - }, - { NULL } -}; - struct var vcc_vars[] = { { "client.ip", IP, 9, "VRT_r_client_ip(sp)", -- 2.39.5