Add VRT_priv_top_get() to parallel VRT_priv_task_get()

Ref 06cf60a0
parent 104bd724
......@@ -216,6 +216,22 @@ VRT_priv_task(VRT_CTX, const void *vmod_id)
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); \
} while(0)
struct vmod_priv *
VRT_priv_top_get(VRT_CTX, const void *vmod_id)
{
struct req *req;
struct sess *sp;
struct reqtop *top;
struct vmod_priv *priv;
VRT_PRIV_TOP_PREP(ctx, req, sp, top);
Lck_Lock(&sp->mtx);
priv = vrt_priv_dynamic_get(top->privs, (uintptr_t)vmod_id);
Lck_Unlock(&sp->mtx);
return (priv);
}
struct vmod_priv *
VRT_priv_top(VRT_CTX, const void *vmod_id)
{
......
......@@ -60,6 +60,7 @@
* VRT_CTX_Assert() added
* VRT_ban_string() signature changed
* VRT_priv_task_get() added
* VRT_priv_top_get() added
* 12.0 (2020-09-15)
* Added VRT_DirectorResolve()
* Added VCL_STRING VRT_BLOB_string(VRT_CTX, VCL_BLOB)
......@@ -600,6 +601,7 @@ void VRT_priv_fini(const struct vmod_priv *p);
struct vmod_priv *VRT_priv_task(VRT_CTX, const void *vmod_id);
struct vmod_priv *VRT_priv_task_get(VRT_CTX, const void *vmod_id);
struct vmod_priv *VRT_priv_top(VRT_CTX, const void *vmod_id);
struct vmod_priv *VRT_priv_top_get(VRT_CTX, const void *vmod_id);
/* Stevedore related functions */
int VRT_Stv(const char *nm);
......
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