]> err.no Git - varnish/commitdiff
Postpone freeing the bereq until after VCL_fetch() has been called
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 29 Oct 2007 10:17:58 +0000 (10:17 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 29 Oct 2007 10:17:58 +0000 (10:17 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2184 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_center.c

index b3936b8005ea974633831b8510303b8cd403f83e..c8a28ef62e4c6fc52276dda68331fff0ae668a55 100644 (file)
@@ -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: