]> err.no Git - varnish/commitdiff
Cache the workspace size from params so it doesn't change under us.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 22 Jan 2007 11:15:57 +0000 (11:15 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 22 Jan 2007 11:15:57 +0000 (11:15 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1235 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_backend.c

index 302531a32029db2c6e58447a1468fd4d0f0ee00b..12c408191a3f6e4963c2482670e2ff15df64f919 100644 (file)
@@ -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);
 }