[master] 9a7413d Sort the sess fields in per session and per request fields, plus a few I have not made up my mind about yet.

Poul-Henning Kamp phk at varnish-cache.org
Thu Dec 22 19:42:40 CET 2011


commit 9a7413d2a7d28333112cb6326e785582373b6684
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Dec 22 18:41:03 2011 +0000

    Sort the sess fields in per session and per request fields, plus a few
    I have not made up my mind about yet.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 08f8adc..46a0d26 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -581,18 +581,13 @@ struct object {
 struct sess {
 	unsigned		magic;
 #define SESS_MAGIC		0x2c2f9c5a
-	int			fd;
-	unsigned		vsl_id;
-	unsigned		xid;
 
-	int			restarts;
-	int			esi_level;
-	int			disable_esi;
+	struct worker		*wrk;
 
-	uint8_t			hash_ignore_busy;
-	uint8_t			hash_always_miss;
+	/* Session related fields ------------------------------------*/
 
-	struct worker		*wrk;
+	int			fd;
+	unsigned		vsl_id;
 
 	socklen_t		sockaddrlen;
 	socklen_t		mysockaddrlen;
@@ -605,6 +600,29 @@ struct sess {
 	char			port[PORT_BUFSIZE];
 	char			*client_identity;
 
+	/* Various internal stuff */
+	struct sessmem		*mem;
+
+	VTAILQ_ENTRY(sess)	poollist;
+	struct acct		acct_ses;
+
+	VTAILQ_ENTRY(sess)	list;
+
+#if defined(HAVE_EPOLL_CTL)
+	struct epoll_event ev;
+#endif
+
+	/* Request related fields ------------------------------------*/
+
+	unsigned		xid;
+
+	int			restarts;
+	int			esi_level;
+	int			disable_esi;
+
+	uint8_t			hash_ignore_busy;
+	uint8_t			hash_always_miss;
+
 	/* HTTP request */
 	const char		*doclose;
 	struct http		*http;
@@ -620,14 +638,6 @@ struct sess {
 	uint8_t			*vary_l;
 	uint8_t			*vary_e;
 
-	struct http_conn	htc[1];
-
-	/* Timestamps, all on TIM_real() timescale */
-	double			t_open;
-	double			t_req;
-	double			t_resp;
-	double			t_end;
-
 	/* Acceptable grace period */
 	struct exp		exp;
 
@@ -639,24 +649,24 @@ struct sess {
 	uint16_t		err_code;
 	const char		*err_reason;
 
-	VTAILQ_ENTRY(sess)	list;
+	/* The busy objhead we sleep on */
+	struct objhead		*hash_objhead;
 
 	struct director		*director;
 	struct VCL_conf		*vcl;
 
-	/* The busy objhead we sleep on */
-	struct objhead		*hash_objhead;
+	uint64_t		req_bodybytes;
 
-	/* Various internal stuff */
-	struct sessmem		*mem;
+	/* TBD fields ------------------------------------------------*/
 
-	VTAILQ_ENTRY(sess)	poollist;
-	uint64_t		req_bodybytes;
-	struct acct		acct_ses;
+	struct http_conn	htc[1];
+
+	/* Timestamps, all on TIM_real() timescale */
+	double			t_open;
+	double			t_req;
+	double			t_resp;
+	double			t_end;
 
-#if defined(HAVE_EPOLL_CTL)
-	struct epoll_event ev;
-#endif
 };
 
 /* Prototypes etc ----------------------------------------------------*/



More information about the varnish-commit mailing list