r5773 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Thu Jan 20 08:07:39 CET 2011


Author: phk
Date: 2011-01-20 08:07:38 +0100 (Thu, 20 Jan 2011)
New Revision: 5773

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_esi_fetch.c
   trunk/varnish-cache/bin/varnishd/cache_gzip.c
Log:
Add separate anchor fields for vgz for reception and esi work.
(The response vgz is a local variable)



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2011-01-19 13:41:46 UTC (rev 5772)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2011-01-20 07:07:38 UTC (rev 5773)
@@ -279,7 +279,8 @@
 	enum body_status	body_status;
 	struct storage		*storage;
 	struct vfp		*vfp;
-	void			*vfp_private;
+	struct vgz		*vgz_rx;
+	struct vgz		*vgz_esi;
 	unsigned		do_esi;
 	unsigned		do_gzip;
 	unsigned		is_gzip;

Modified: trunk/varnish-cache/bin/varnishd/cache_esi_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_esi_fetch.c	2011-01-19 13:41:46 UTC (rev 5772)
+++ trunk/varnish-cache/bin/varnishd/cache_esi_fetch.c	2011-01-20 07:07:38 UTC (rev 5773)
@@ -111,6 +111,7 @@
 static int __match_proto__()
 vfp_esi_bytes_gu(struct sess *sp, struct http_conn *htc, size_t bytes)
 {
+
 	return (vfp_esi_bytes_uu(sp, htc, bytes));
 }
 

Modified: trunk/varnish-cache/bin/varnishd/cache_gzip.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_gzip.c	2011-01-19 13:41:46 UTC (rev 5772)
+++ trunk/varnish-cache/bin/varnishd/cache_gzip.c	2011-01-20 07:07:38 UTC (rev 5773)
@@ -171,6 +171,9 @@
 	 * memLevel [1..9] (-> 1K->256K)
 	 *
 	 * XXX: They probably needs to be params...
+	 *
+	 * XXX: It may be more efficent to malloc them, rather than have
+	 * XXX: too many worker threads grow the stacks.
 	 */
 	i = deflateInit2(&vg->vz,
 	    0,				/* Level */
@@ -286,7 +289,7 @@
 vfp_gunzip_begin(struct sess *sp, size_t estimate)
 {
 	(void)estimate;
-	sp->wrk->vfp_private = VGZ_NewUngzip(sp, sp->ws);
+	sp->wrk->vgz_rx = VGZ_NewUngzip(sp, sp->ws);
 }
 
 static int __match_proto__()
@@ -300,7 +303,8 @@
 	size_t dl;
 	const void *dp;
 
-	CAST_OBJ_NOTNULL(vg, sp->wrk->vfp_private, VGZ_MAGIC);
+	vg = sp->wrk->vgz_rx;
+	CHECK_OBJ_NOTNULL(vg, VGZ_MAGIC);
 	AZ(vg->vz.avail_in);
 	while (bytes > 0 || vg->vz.avail_in > 0) {
 		if (sp->wrk->storage == NULL)
@@ -346,7 +350,8 @@
 	struct vgz *vg;
 	struct storage *st;
 
-	CAST_OBJ_NOTNULL(vg, sp->wrk->vfp_private, VGZ_MAGIC);
+	vg = sp->wrk->vgz_rx;
+	CHECK_OBJ_NOTNULL(vg, VGZ_MAGIC);
 	VGZ_Destroy(&vg);
 
 	st = sp->wrk->storage;
@@ -381,11 +386,9 @@
 static void __match_proto__()
 vfp_gzip_begin(struct sess *sp, size_t estimate)
 {
-	struct vgz *vg;
 	(void)estimate;
 
-	vg = VGZ_NewGzip(sp, sp->ws);
-	sp->wrk->vfp_private = vg;
+	sp->wrk->vgz_rx = VGZ_NewGzip(sp, sp->ws);
 }
 
 static int __match_proto__()
@@ -399,7 +402,8 @@
 	size_t dl;
 	const void *dp;
 
-	CAST_OBJ_NOTNULL(vg, sp->wrk->vfp_private, VGZ_MAGIC);
+	vg = sp->wrk->vgz_rx;
+	CHECK_OBJ_NOTNULL(vg, VGZ_MAGIC);
 	AZ(vg->vz.avail_in);
 	while (bytes > 0 || vg->vz.avail_in > 0) {
 		if (sp->wrk->storage == NULL)
@@ -445,7 +449,8 @@
 	struct vgz *vg;
 	struct storage *st;
 
-	CAST_OBJ_NOTNULL(vg, sp->wrk->vfp_private, VGZ_MAGIC);
+	vg = sp->wrk->vgz_rx;
+	CHECK_OBJ_NOTNULL(vg, VGZ_MAGIC);
 	VGZ_Destroy(&vg);
 
 	st = sp->wrk->storage;




More information about the varnish-commit mailing list