[master] 4d4e9f7 Use the req workspace, not the worker workspace, as we cannot trust that to be the same throughout the request.

Poul-Henning Kamp phk at varnish-cache.org
Thu Feb 9 00:09:49 CET 2012


commit 4d4e9f7f2a079290bad85275ac9146b49df1a32e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Feb 8 23:09:12 2012 +0000

    Use the req workspace, not the worker workspace, as we cannot
    trust that to be the same throughout the request.

diff --git a/lib/libvmod_std/vmod_std.c b/lib/libvmod_std/vmod_std.c
index b2ab419..e363b2d 100644
--- a/lib/libvmod_std/vmod_std.c
+++ b/lib/libvmod_std/vmod_std.c
@@ -58,8 +58,8 @@ vmod_updown(struct sess *sp, int up, const char *s, va_list ap)
 	const char *p;
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
-	u = WS_Reserve(sp->wrk->ws, 0);
-	e = b = sp->wrk->ws->f;
+	u = WS_Reserve(sp->req->ws, 0);
+	e = b = sp->req->ws->f;
 	e += u;
 	p = s;
 	while (p != vrt_magic_string_end && b < e) {
@@ -76,12 +76,12 @@ vmod_updown(struct sess *sp, int up, const char *s, va_list ap)
 		*b = '\0';
 	b++;
 	if (b > e) {
-		WS_Release(sp->wrk->ws, 0);
+		WS_Release(sp->req->ws, 0);
 		return (NULL);
 	} else {
 		e = b;
-		b = sp->wrk->ws->f;
-		WS_Release(sp->wrk->ws, e - b);
+		b = sp->req->ws->f;
+		WS_Release(sp->req->ws, e - b);
 		return (b);
 	}
 }



More information about the varnish-commit mailing list