r2551 - in trunk/varnish-cache: bin/varnishd include lib/libvcl

des at projects.linpro.no des at projects.linpro.no
Tue Mar 4 11:59:33 CET 2008


Author: des
Date: 2008-03-04 11:59:32 +0100 (Tue, 04 Mar 2008)
New Revision: 2551

Modified:
   trunk/varnish-cache/bin/varnishd/cache_vrt.c
   trunk/varnish-cache/include/vrt_obj.h
   trunk/varnish-cache/lib/libvcl/vcc_obj.c
Log:
Implement obj.hash.


Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c	2008-03-04 10:58:02 UTC (rev 2550)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c	2008-03-04 10:59:32 UTC (rev 2551)
@@ -539,6 +539,16 @@
 	return (TIM_real() - sp->obj->last_use);
 }
 
+const char *
+VRT_r_obj_hash(struct sess *sp)
+{
+
+	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+	CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
+	CHECK_OBJ_NOTNULL(sp->obj->objhead, OBJHEAD_MAGIC);
+	return (sp->obj->objhead->hash);
+}
+
 int
 VRT_r_backend_health(const struct sess *sp)
 {

Modified: trunk/varnish-cache/include/vrt_obj.h
===================================================================
--- trunk/varnish-cache/include/vrt_obj.h	2008-03-04 10:58:02 UTC (rev 2550)
+++ trunk/varnish-cache/include/vrt_obj.h	2008-03-04 10:59:32 UTC (rev 2551)
@@ -43,6 +43,7 @@
 double VRT_r_obj_prefetch(const struct sess *);
 void VRT_l_obj_prefetch(const struct sess *, double);
 double VRT_r_obj_lastuse(const struct sess *);
+const char *VRT_r_obj_hash(struct sess *sp);
 const char * VRT_r_resp_proto(const struct sess *);
 void VRT_l_resp_proto(const struct sess *, const char *, ...);
 int VRT_r_resp_status(const struct sess *);

Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_obj.c	2008-03-04 10:58:02 UTC (rev 2550)
+++ trunk/varnish-cache/lib/libvcl/vcc_obj.c	2008-03-04 10:59:32 UTC (rev 2551)
@@ -179,6 +179,13 @@
 	    0,
 	    VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER | VCL_MET_DISCARD | VCL_MET_TIMEOUT
 	},
+	{ "obj.hash", HASH, 8,
+	    NULL,
+	    "VRT_l_req_hash(sp, ",
+	    V_RO,
+	    0,
+	    VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
+	},
 	{ "resp.proto", STRING, 10,
 	    "VRT_r_resp_proto(sp)",
 	    "VRT_l_resp_proto(sp, ",




More information about the varnish-commit mailing list