Commit bfc395da authored by Geoff Simmons's avatar Geoff Simmons

Bugfix finalizing the mutex for key memory pages.

parent 5cad086d
......@@ -77,6 +77,7 @@ static struct key_ent key_tbl[UINT8_MAX + 1];
static long pagesz = 0;
static struct VSC_lck *lck_page;
static struct vsc_seg *lck_page_vsc_seg;
static struct lock page_mtx;
/* List of allocated key pages */
......@@ -190,7 +191,7 @@ KEY_Init(VRT_CTX)
return (-1);
}
lck_page = Lck_CreateClass(NULL, "ece.key_mem");
lck_page = Lck_CreateClass(&lck_page_vsc_seg, "ece.key_mem");
AN(lck_page);
Lck_New(&page_mtx, lck_page);
if (key_alloc_page(ctx) != 0)
......@@ -289,6 +290,7 @@ KEY_Fini(void)
}
}
Lck_Delete(&page_mtx);
Lck_DestroyClass(&lck_page_vsc_seg);
}
void
......
......@@ -24,11 +24,8 @@ varnish v1 -cli "vcl.use vcl2"
varnish v1 -cli "vcl.discard vcl1"
varnish v1 -cli "vcl.list"
# Lock destroyed on last discard
varnish v1 -vsc LCK.ece.key_mem.*
varnish v1 -expect LCK.ece.key_mem.creat == 1
varnish v1 -expect LCK.ece.key_mem.destroy == 1
varnish v1 -expect LCK.ece.key_mem.locks == 1
# Lock destroyed on last discard (log shows no LCK.ece.key_mem.*).
varnish v1 -vsc LCK.*
varnish v1 -vcl {
import ${vmod_ece};
......@@ -58,3 +55,8 @@ client c1 {
expect resp.http.x-version ~ "^.+$"
expect resp.http.x-libcrypto-version ~ "^.+$"
} -run
# Lock exists again after new load.
varnish v1 -vsc LCK.ece.key_mem.*
varnish v1 -expect LCK.ece.key_mem.creat == 1
varnish v1 -expect LCK.ece.key_mem.locks == 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment