From: phk Date: Mon, 29 Oct 2007 10:17:58 +0000 (+0000) Subject: Postpone freeing the bereq until after VCL_fetch() has been called X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62467fe468670c8b695722c14d3f890df607aff2;p=varnish Postpone freeing the bereq until after VCL_fetch() has been called git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2184 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index b3936b80..c8a28ef6 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -310,9 +310,6 @@ cnt_fetch(struct sess *sp) 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 @@ cnt_fetch(struct sess *sp) 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: