[master] 58a062a Pack struct sess slightly smarter, and get its allocation size (incl memitem) down to 512 bytes, despite ridiculously large sockaddr_storage structs.

Poul-Henning Kamp phk at varnish-cache.org
Mon Jan 2 11:23:58 CET 2012


commit 58a062a6e39a11a3dd436be5c03792ef1f868f05
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 2 10:23:18 2012 +0000

    Pack struct sess slightly smarter, and get its allocation size
    (incl memitem) down to 512 bytes, despite ridiculously large
    sockaddr_storage structs.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index a15f272..75bc803 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -630,6 +630,10 @@ struct sess {
 	unsigned		magic;
 #define SESS_MAGIC		0x2c2f9c5a
 
+	enum step		step;
+	int			fd;
+	unsigned		vsl_id;
+
 	/* Cross references ------------------------------------------*/
 
 	struct sesspool		*sesspool;
@@ -640,9 +644,6 @@ struct sess {
 
 	/* Session related fields ------------------------------------*/
 
-	int			fd;
-	unsigned		vsl_id;
-
 	socklen_t		sockaddrlen;
 	socklen_t		mysockaddrlen;
 	struct sockaddr_storage	sockaddr;
@@ -658,18 +659,11 @@ struct sess {
 	/* Timestamps, all on TIM_real() timescale */
 	double			t_open;		/* fd accepted */
 	double			t_idle;		/* fd accepted or resp sent */
+	double			t_req;
 
 #if defined(HAVE_EPOLL_CTL)
 	struct epoll_event ev;
 #endif
-	enum step		step;
-
-	/* Request related fields ------------------------------------*/
-
-
-	/* Timestamps, all on TIM_real() timescale */
-	double			t_req;
-
 };
 
 /* Prototypes etc ----------------------------------------------------*/



More information about the varnish-commit mailing list