[master] 08fad22 Add bereq.retries variable

Poul-Henning Kamp phk at varnish-cache.org
Tue Jun 25 14:09:51 CEST 2013


commit 08fad2250aad122ead575f0fecbf5fd60c453a92
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Jun 25 12:09:41 2013 +0000

    Add bereq.retries variable

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index c0de28c..fb67dee 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -507,6 +507,7 @@ struct busyobj {
 	 * All fields from refcount and down are zeroed when the busyobj
 	 * is recycled.
 	 */
+	int			retries;
 	unsigned		refcount;
 	double			t_fetch;
 	uint16_t		err_code;
diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c
index 7e9f133..0491b30 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -383,6 +383,15 @@ VRT_r_req_restarts(const struct vrt_ctx *ctx)
 	return (ctx->req->restarts);
 }
 
+long
+VRT_r_bereq_retries(const struct vrt_ctx *ctx)
+{
+
+	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
+	CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC);
+	return (ctx->bo->retries);
+}
+
 /*--------------------------------------------------------------------
  * NB: TTL is relative to when object was created, whereas grace and
  * keep are relative to ttl.
diff --git a/lib/libvcl/generate.py b/lib/libvcl/generate.py
index fd2573d..d358351 100755
--- a/lib/libvcl/generate.py
+++ b/lib/libvcl/generate.py
@@ -217,6 +217,11 @@ sp_variables = (
 		( 'recv',),
 		( 'recv',),
 	),
+	('bereq.retries',
+		'INT',
+		( 'backend',),
+		( ),
+	),
 	('bereq.backend',
 		'BACKEND',
 		( 'backend', ),



More information about the varnish-commit mailing list