[master] 6e49350 Tighten up the management of the do_close flag.

Poul-Henning Kamp phk at varnish-cache.org
Mon Apr 4 11:07:47 CEST 2011


commit 6e4935020849560dd09aa71fa7e8ed3971168f68
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Apr 4 09:07:21 2011 +0000

    Tighten up the management of the do_close flag.
    
    Fixes	#890

diff --git a/bin/varnishd/cache_center.c b/bin/varnishd/cache_center.c
index 45470f6..7c4cb32 100644
--- a/bin/varnishd/cache_center.c
+++ b/bin/varnishd/cache_center.c
@@ -488,7 +488,6 @@ cnt_fetch(struct sess *sp)
 	if (i) {
 		sp->handling = VCL_RET_ERROR;
 		sp->err_code = 503;
-		sp->wrk->do_close = 0;
 	} else {
 		/*
 		 * These two headers can be spread over multiple actual headers
@@ -541,6 +540,7 @@ cnt_fetch(struct sess *sp)
 	}
 
 	/* Clean up partial fetch */
+	AZ(sp->vbc);
 
 	if (sp->objcore != NULL) {
 		CHECK_OBJ_NOTNULL(sp->objcore, OBJCORE_MAGIC);
@@ -729,7 +729,6 @@ cnt_fetchbody(struct sess *sp)
 	/* Use unmodified headers*/
 	i = FetchBody(sp);
 
-	sp->wrk->do_close = 0;
 	sp->wrk->h_content_length = NULL;
 
 	http_Setup(sp->wrk->bereq, NULL);
diff --git a/bin/varnishd/cache_dir.c b/bin/varnishd/cache_dir.c
index 1b03044..615ab87 100644
--- a/bin/varnishd/cache_dir.c
+++ b/bin/varnishd/cache_dir.c
@@ -62,6 +62,7 @@ VDI_CloseFd(struct sess *sp)
 	sp->vbc->backend = NULL;
 	VBE_ReleaseConn(sp->vbc);
 	sp->vbc = NULL;
+	sp->wrk->do_close = 0;
 }
 
 /* Recycle a connection ----------------------------------------------*/
@@ -74,6 +75,7 @@ VDI_RecycleFd(struct sess *sp)
 	CHECK_OBJ_NOTNULL(sp->vbc, VBC_MAGIC);
 	CHECK_OBJ_NOTNULL(sp->vbc->backend, BACKEND_MAGIC);
 	assert(sp->vbc->fd >= 0);
+	AZ(sp->wrk->do_close);
 
 	bp = sp->vbc->backend;
 



More information about the varnish-commit mailing list