Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
7acaae62
Commit
7acaae62
authored
Mar 09, 2015
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
straighten the vmod PRIV_* doc
parent
09628c73
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
+21
-20
vmod.rst
doc/sphinx/reference/vmod.rst
+21
-20
No files found.
doc/sphinx/reference/vmod.rst
View file @
7acaae62
...
@@ -234,28 +234,29 @@ It is often useful for library functions to maintain local state,
...
@@ -234,28 +234,29 @@ It is often useful for library functions to maintain local state,
this can be anything from a precompiled regexp to open file descriptors
this can be anything from a precompiled regexp to open file descriptors
and vast data structures.
and vast data structures.
The VCL compiler supports three levels of private pointers, "per
The VCL compiler supports the following private pointers:
call", "per VCL" and "per task".
* ``PRIV_CALL`` "per call" private pointers are useful to cache/store
"per call" private pointers are useful to cache/store state relative
state relative to the specific call or its arguments, for instance a
to the specific call or its arguments, for instance a compiled regular
compiled regular expression specific to a regsub() statement or a
expression specific to a regsub() statement or a simply caching the
simply caching the last output of some expensive lookup.
last output of some expensive lookup.
* ``PRIV_VCL`` "per vcl" private pointers are useful for such global
"per vcl" private pointers are useful for such global state that
state that applies to all calls in this VCL, for instance flags that
applies to all calls in this VCL, for instance flags that determine
determine if regular expressions are case-sensitive in this vmod or
if regular expressions are case-sensitive in this vmod or similar.
similar.
"per task" private pointers are useful for state that applies to calls
* ``PRIV_TASK`` "per task" private pointers are useful for state that
for either a specific request or a backend request. For instance this
applies to calls for either a specific request or a backend
can be the result of a parsed cookie specific to a client. Note that
request. For instance this can be the result of a parsed cookie
"per task" contexts are separate for the client side and the backend
specific to a client. Note that ``PRIV_TASK`` contexts are separate
side, so use in ``vcl_backend_*`` will yield a different private pointer
for the client side and the backend side, so use in
from the one used on the client side.
``vcl_backend_*`` will yield a different private pointer from the
one used on the client side.
The way it works in the vmod code, is that a ``struct vmod_priv *`` is
The way it works in the vmod code, is that a ``struct vmod_priv *`` is
passed to the functions where
argument type PRIV_VCL, PRIV_CALL or
passed to the functions where
one of the ``PRIV_*`` argument types is
PRIV_TASK is
specified.
specified.
This structure contains two members::
This structure contains two members::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment