From 6ce292bea4e13c8bfd41a551c6a10fdccaf3691a Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 22 Jan 2007 11:15:57 +0000 Subject: [PATCH] Cache the workspace size from params so it doesn't change under us. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1235 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_backend.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_backend.c b/varnish-cache/bin/varnishd/cache_backend.c index 302531a3..12c40819 100644 --- a/varnish-cache/bin/varnishd/cache_backend.c +++ b/varnish-cache/bin/varnishd/cache_backend.c @@ -64,9 +64,10 @@ static struct vbe_conn * vbe_new_conn(void) { struct vbe_conn *vbc; - unsigned char *p; + unsigned char *p, space; - vbc = calloc(sizeof *vbc + params->mem_workspace * 2, 1); + space = params->mem_workspace; + vbc = calloc(sizeof *vbc + space * 2, 1); if (vbc == NULL) return (NULL); VSL_stats->n_vbe_conn++; @@ -75,9 +76,9 @@ vbe_new_conn(void) vbc->http2 = &vbc->http_mem[1]; vbc->fd = -1; p = (void *)(vbc + 1); - http_Setup(vbc->http, p, params->mem_workspace); - p += params->mem_workspace; - http_Setup(vbc->http2, p, params->mem_workspace); + http_Setup(vbc->http, p, space); + p += space; + http_Setup(vbc->http2, p, space); return (vbc); } -- 2.39.5