[master] c13365e Flush the req->vsl on a panic.

Poul-Henning Kamp phk at varnish-cache.org
Wed Apr 3 12:18:34 CEST 2013


commit c13365e028926e16a7a2c9aaf842c6972f97995e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Apr 3 10:18:20 2013 +0000

    Flush the req->vsl on a panic.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index a63c36e..31b8384 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -910,7 +910,7 @@ extern volatile struct params * cache_param;
 void THR_SetName(const char *name);
 const char* THR_GetName(void);
 void THR_SetRequest(const struct req *);
-const struct req * THR_GetRequest(void);
+struct req * THR_GetRequest(void);
 
 /* cache_lck.c */
 
diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index 13c6612..dfdbfa5 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -60,7 +60,7 @@ THR_SetRequest(const struct req *req)
 	AZ(pthread_setspecific(req_key, req));
 }
 
-const struct req *
+struct req *
 THR_GetRequest(void)
 {
 
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index dd9b2d7..3f49033 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -388,7 +388,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
     int err, enum vas_e kind)
 {
 	const char *q;
-	const struct req *req;
+	struct req *req;
 
 	AZ(pthread_mutex_lock(&panicstr_mtx)); /* Won't be released,
 						  we're going to die
@@ -437,6 +437,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
 		req = THR_GetRequest();
 		if (req != NULL)
 			pan_req(req);
+			VSL_Flush(req->vsl, 0);
 	}
 	VSB_printf(pan_vsp, "\n");
 	VSB_bcat(pan_vsp, "", 1);	/* NUL termination */



More information about the varnish-commit mailing list