Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Dev

[PATCH 07/25] Don't free the object store when fetch fails and streaming is in effect, as there might be threads reading this data.

 

 

Varnish dev RSS feed   Index | Next | Previous | View Threaded


martin at varnish-software

Jan 22, 2012, 9:53 AM

Post #1 of 1 (48 views)
Permalink
[PATCH 07/25] Don't free the object store when fetch fails and streaming is in effect, as there might be threads reading this data.

---
bin/varnishd/cache/cache_fetch.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index b9e7ef0..f69d80f 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -580,11 +580,14 @@ FetchBody(struct worker *wrk, struct busyobj *bo)

if (cls < 0) {
wrk->stats.fetch_failed++;
- /* XXX: Wouldn't this store automatically be released ? */
- while (!VTAILQ_EMPTY(&obj->store)) {
- st = VTAILQ_FIRST(&obj->store);
- VTAILQ_REMOVE(&obj->store, st, list);
- STV_free(st);
+ if (bo->do_stream == 0) {
+ /* XXX: Wouldn't this store automatically be
+ * released ? */
+ while (!VTAILQ_EMPTY(&obj->store)) {
+ st = VTAILQ_FIRST(&obj->store);
+ VTAILQ_REMOVE(&obj->store, st, list);
+ STV_free(st);
+ }
}
VDI_CloseFd(wrk, &bo->vbc);
obj->len = 0;
--
1.7.4.1


_______________________________________________
varnish-dev mailing list
varnish-dev [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Varnish dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.