From af80beed3f52a8d1c9f5b48f2bff2d3e1c6c0613 Mon Sep 17 00:00:00 2001 From: Jocelyn De La Rosa Date: Thu, 3 May 2012 13:54:29 +0200 Subject: [PATCH] Release the stream_busyobj if we go to error while another thread is streaming --- bin/varnishd/cache_center.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/bin/varnishd/cache_center.c b/bin/varnishd/cache_center.c index 45da018..396d3c5 100644 --- a/bin/varnishd/cache_center.c +++ b/bin/varnishd/cache_center.c @@ -515,6 +515,15 @@ cnt_error(struct sess *sp) sp->doclose = "error"; sp->wantbody = 1; + /* If the object was streamed, we don't want to hold the busyobj */ + if (sp->stream_busyobj) { + Lck_Lock(&sp->stream_busyobj->mtx); + sp->stream_busyobj->stream_refcnt--; + Lck_Unlock(&sp->stream_busyobj->mtx); + sp->stream_busyobj = NULL; + } + assert(sp->stream_busyobj == NULL); + assert(sp->handling == VCL_RET_DELIVER); sp->err_code = 0; sp->err_reason = NULL; -- 1.7.2.5