Hi, The hash director needs a string now so this no longer needed.
Opinions?
From 4226338a02a7791807d7b75f462001ad785659b3 Mon Sep 17 00:00:00 2001 From: "Federico G. Schwindt" <[email protected]> Date: Wed, 1 Jul 2015 13:54:07 +0100 Subject: [PATCH] Retire client.identity The hash director needs a string so it's no longer needed. --- bin/varnishd/cache/cache.h | 1 - bin/varnishd/cache/cache_req_fsm.c | 1 - bin/varnishd/cache/cache_vrt_var.c | 32 -------------------------------- bin/varnishtest/tests/v00025.vtc | 5 ----- lib/libvcc/generate.py | 8 -------- lib/libvmod_directors/vmod.vcc | 3 +-- 6 files changed, 1 insertion(+), 49 deletions(-) diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h index b96d765..56b65cc 100644 --- a/bin/varnishd/cache/cache.h +++ b/bin/varnishd/cache/cache.h @@ -568,7 +568,6 @@ struct req { double t_req; /* Headers complete */ struct http_conn htc[1]; - const char *client_identity; /* HTTP request */ struct http *http; diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c index b0fe1e7..8011229 100644 --- a/bin/varnishd/cache/cache_req_fsm.c +++ b/bin/varnishd/cache/cache_req_fsm.c @@ -660,7 +660,6 @@ cnt_recv(struct worker *wrk, struct req *req) req->disable_esi = 0; req->hash_always_miss = 0; req->hash_ignore_busy = 0; - req->client_identity = NULL; http_CollectHdr(req->http, H_Cache_Control); diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c index cc302c5..fbbec0b 100644 --- a/bin/varnishd/cache/cache_vrt_var.c +++ b/bin/varnishd/cache/cache_vrt_var.c @@ -234,38 +234,6 @@ VRT_r_beresp_uncacheable(VRT_CTX) /*--------------------------------------------------------------------*/ -const char * -VRT_r_client_identity(VRT_CTX) -{ - - CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); - CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); - if (ctx->req->client_identity != NULL) - return (ctx->req->client_identity); - return(SES_Get_String_Attr(ctx->req->sp, SA_CLIENT_IP)); -} - -void -VRT_l_client_identity(VRT_CTX, const char *str, ...) -{ - va_list ap; - const char *b; - - CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); - CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); - va_start(ap, str); - b = VRT_String(ctx->req->http->ws, NULL, str, ap); - va_end(ap); - if (b == NULL) { - VSLb(ctx->vsl, SLT_LostHeader, "client.identity"); - WS_MarkOverflow(ctx->req->http->ws); - return; - } - ctx->req->client_identity = b; -} - -/*--------------------------------------------------------------------*/ - #define BEREQ_TIMEOUT(which) \ void \ VRT_l_bereq_##which(VRT_CTX, double num) \ diff --git a/bin/varnishtest/tests/v00025.vtc b/bin/varnishtest/tests/v00025.vtc index fbb0fb8..303a660 100644 --- a/bin/varnishtest/tests/v00025.vtc +++ b/bin/varnishtest/tests/v00025.vtc @@ -9,10 +9,6 @@ varnish v1 -arg "-i J.F.Nobody" -vcl+backend { import ${vmod_std}; - sub vcl_recv { - set client.identity = "Samuel B. Nobody"; - } - sub vcl_deliver { set resp.http.server_port = std.port(server.ip); set resp.http.server_port_foo = std.port(server.ip) + "_foo"; @@ -21,7 +17,6 @@ varnish v1 -arg "-i J.F.Nobody" -vcl+backend { set resp.http.id = server.identity; set resp.http.esi = req.esi; set resp.http.be = req.backend_hint; - set resp.http.c_id = client.identity; set resp.http.l_ip = local.ip; set resp.http.r_ip = remote.ip; if (obj.uncacheable) { } diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py index 6d6915a..9a428e8 100755 --- a/lib/libvcc/generate.py +++ b/lib/libvcc/generate.py @@ -173,14 +173,6 @@ sp_variables = [ The client's IP address. """ ), - ('client.identity', - 'STRING', - ( 'client',), - ( 'client',), """ - Identification of the client, used to load balance - in the client director. - """ - ), ('local.ip', 'IP', ( 'client',), diff --git a/lib/libvmod_directors/vmod.vcc b/lib/libvmod_directors/vmod.vcc index 2e958a7..ef8fb67 100644 --- a/lib/libvmod_directors/vmod.vcc +++ b/lib/libvmod_directors/vmod.vcc @@ -152,8 +152,7 @@ Description The director chooses the backend server by computing a hash/digest of the string given to .backend(). - Commonly used with ``client.identity`` or a session cookie to get - sticky sessions. + Commonly used with a session cookie to get sticky sessions. Example new vdir = directors.hash(); -- 2.1.4
_______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
