Mailing List Archive

r1235 - trunk/varnish-cache/bin/varnishd
Author: phk
Date: 2007-01-22 12:15:57 +0100 (Mon, 22 Jan 2007)
New Revision: 1235

Modified:
trunk/varnish-cache/bin/varnishd/cache_backend.c
Log:
Cache the workspace size from params so it doesn't change under us.


Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c 2007-01-22 11:15:27 UTC (rev 1234)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c 2007-01-22 11:15:57 UTC (rev 1235)
@@ -64,9 +64,10 @@
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 @@
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);
}