Commit 4e0004ea authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Eliminate some grubbing around inside struct ws

parent 92e77b87
......@@ -915,7 +915,7 @@ CNT_Request(struct worker *wrk, struct req *req)
* empty on state-transitions.
*/
WS_Assert(wrk->aws);
assert(wrk->aws->s == wrk->aws->f);
AZ(WS_Snapshot(wrk->aws));
switch (req->req_step) {
#define REQ_STEP(l,u,arg) \
......
......@@ -215,7 +215,7 @@ WS_Snapshot(struct ws *ws)
WS_Assert(ws);
assert(ws->r == NULL);
DSL(DBG_WORKSPACE, 0, "WS_Snapshot(%p) = %p", ws, ws->f);
return ((uintptr_t)ws->f);
return (ws->f == ws->s ? 0 : (uintptr_t)ws->f);
}
unsigned
......
......@@ -420,14 +420,17 @@ VCL_INT
vmod_workspace_free(VRT_CTX, VCL_ENUM which)
{
struct ws *ws;
unsigned u;
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
ws = wsfind(ctx, which);
WS_Assert(ws);
AZ(ws->r);
u = WS_Reserve(ws, 0);
WS_Release(ws, 0);
return (pdiff(ws->f, ws->e));
return (u);
}
VCL_BOOL
......
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