r2184 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Oct 29 11:18:35 CET 2007


Author: phk
Date: 2007-10-29 11:17:58 +0100 (Mon, 29 Oct 2007)
New Revision: 2184

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
Log:
Postpone freeing the bereq until after VCL_fetch() has been called


Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2007-10-29 09:28:21 UTC (rev 2183)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2007-10-29 10:17:58 UTC (rev 2184)
@@ -310,9 +310,6 @@
 	i = Fetch(sp);
 	CHECK_OBJ_NOTNULL(sp->backend, BACKEND_MAGIC);
 
-	VBE_free_bereq(sp->bereq);
-	sp->bereq = NULL;
-
 	if (!i)
 		RFC2616_cache_policy(sp, sp->obj->http);	/* XXX -> VCL */
 	else {
@@ -325,6 +322,9 @@
 	sp->err_code = http_GetStatus(sp->obj->http);
 	VCL_fetch_method(sp);
 
+	VBE_free_bereq(sp->bereq);
+	sp->bereq = NULL;
+
 	switch (sp->handling) {
 	case VCL_RET_ERROR:
 	case VCL_RET_RESTART:




More information about the varnish-commit mailing list