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
c0903203
Commit
c0903203
authored
Jan 31, 2019
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the rst anchors we generated for vmods be the vcl-syntax name:
Ie: vmod.cache_req_body instead of func_cache_req_body
parent
7294cced
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
52 additions
and
50 deletions
+52
-50
directors.rst
doc/sphinx/reference/directors.rst
+1
-1
upgrading-5.1.rst
doc/sphinx/whats-new/upgrading-5.1.rst
+3
-3
upgrading-5.2.rst
doc/sphinx/whats-new/upgrading-5.2.rst
+1
-1
upgrading-6.0.rst
doc/sphinx/whats-new/upgrading-6.0.rst
+3
-3
upgrading-6.1.rst
doc/sphinx/whats-new/upgrading-6.1.rst
+1
-1
vmodtool.py
lib/libvcc/vmodtool.py
+17
-16
vmod.vcc
lib/libvmod_blob/vmod.vcc
+6
-5
vmod.vcc
lib/libvmod_directors/vmod.vcc
+19
-19
vmod.vcc
lib/libvmod_std/vmod.vcc
+1
-1
No files found.
doc/sphinx/reference/directors.rst
View file @
c0903203
...
...
@@ -155,7 +155,7 @@ Health Probes
=============
It is possible in a VCL program to query the health of a director (see
:ref:`
func_
healthy`). A director can report its health if it implements the
:ref:`
vmod_std.
healthy`). A director can report its health if it implements the
``healthy`` function, it is otherwise always considered healthy.
Unless you are making a dynamic backend, you need to take care of the
...
...
doc/sphinx/whats-new/upgrading-5.1.rst
View file @
c0903203
...
...
@@ -197,7 +197,7 @@ vcl_recv
* Added ``req.storage``, which tells Varnish which storage backend to
use if you choose to save the request body (see
:ref:`
func_
cache_req_body`).
:ref:`
vmod_std.
cache_req_body`).
* ``return(vcl(LABEL))`` may not be called after a restart. It can
only be called from the active VCL instance.
...
...
@@ -232,9 +232,9 @@ nuke limit is used in all cases.
vmod_std
~~~~~~~~
* Added ``std.getenv()``, see :ref:`
func_
getenv`.
* Added ``std.getenv()``, see :ref:`
vmod_std.
getenv`.
* Added ``std.late_100_continue()``, see :ref:`
func_
late_100_continue`.
* Added ``std.late_100_continue()``, see :ref:`
vmod_std.
late_100_continue`.
Other changes
=============
...
...
doc/sphinx/whats-new/upgrading-5.2.rst
View file @
c0903203
...
...
@@ -121,7 +121,7 @@ situation.
vmod_std
~~~~~~~~
Added :ref:`
func_
file_exists`.
Added :ref:`
vmod_std.
file_exists`.
New VMODs in the standard distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
doc/sphinx/whats-new/upgrading-6.0.rst
View file @
c0903203
...
...
@@ -461,9 +461,9 @@ backend, or set a value for the Host header in VCL.
VMOD std
--------
:ref:`std.port(IP) <
func_
port>` always returns 0 when applied to a
:ref:`std.port(IP) <
vmod_std.
port>` always returns 0 when applied to a
``*.ip`` variable whose value is set to ``0.0.0.0`` because the
listener is UDS. :ref:`std.set_ip_tos(INT) <
func_
set_ip_tos>` is
listener is UDS. :ref:`std.set_ip_tos(INT) <
vmod_std.
set_ip_tos>` is
silently ignored when the listener is UDS.
The ``shard`` director
...
...
@@ -519,7 +519,7 @@ except for ``req.restarts`` and ``req.xid``, which change by design.
If you need to reset the client request headers to their original
state (before changes in VCL), call
:ref:`std.rollback(req) <
func_
rollback>`.
:ref:`std.rollback(req) <
vmod_std.
rollback>`.
``return(restart)`` can now be called from ``vcl_recv{}``.
...
...
doc/sphinx/whats-new/upgrading-6.1.rst
View file @
c0903203
...
...
@@ -138,7 +138,7 @@ Other changes to VCL
VMODs
=====
Added the :ref:`
func_
fnmatch` function to :ref:`vmod_std(3)`, which
Added the :ref:`
vmod_std.
fnmatch` function to :ref:`vmod_std(3)`, which
you can use for shell-style wildcard matching. Wildcard patterns may
be a good fit for matching URLs, to match against a pattern like
``/foo/*/bar/*``. The patterns can be built at runtime, if you need to
...
...
lib/libvcc/vmodtool.py
View file @
c0903203
...
...
@@ -398,13 +398,13 @@ class ProtoType(object):
s
+=
t
.
replace
(
"@"
,
" "
)
+
")"
return
s
def
rst
head
(
self
,
fo
):
def
rst
_proto
(
self
,
fo
,
sep
=
'-'
):
s
=
self
.
vcl_proto
(
False
)
if
len
(
s
)
<
60
:
write_rst_hdr
(
fo
,
s
,
'-'
)
write_rst_hdr
(
fo
,
s
,
sep
)
else
:
s
=
self
.
vcl_proto
(
True
)
write_rst_hdr
(
fo
,
s
,
'-'
)
write_rst_hdr
(
fo
,
s
,
sep
)
fo
.
write
(
"
\n
::
\n\n
"
+
self
.
vcl_proto
(
False
,
pfx
=
" "
)
+
"
\n
"
)
def
cname
(
self
,
pfx
=
False
):
...
...
@@ -508,15 +508,15 @@ class Stanza(object):
warn
=
False
)
def
rstfile
(
self
,
fo
,
man
):
if
self
.
rstlbl
:
fo
.
write
(
"
\n
.. _"
+
self
.
rstlbl
+
":
\n
"
)
self
.
rsthead
(
fo
,
man
)
self
.
rstdoc
(
fo
,
man
)
def
rsthead
(
self
,
fo
,
unused_man
):
''' Emit the systematic part of the documentation '''
if
self
.
rstlbl
:
fo
.
write
(
'
\n
.. _'
+
self
.
rstlbl
+
':
\n
'
)
if
self
.
proto
:
self
.
proto
.
rst
head
(
fo
)
self
.
proto
.
rst
_proto
(
fo
)
fo
.
write
(
"
\n
"
)
def
rstdoc
(
self
,
fo
,
unused_man
):
...
...
@@ -527,7 +527,7 @@ class Stanza(object):
if
man
and
self
.
proto
:
fo
.
write
(
self
.
proto
.
vcl_proto
(
True
,
pfx
=
" "
)
+
'
\n
\n
'
)
elif
self
.
proto
and
self
.
rstlbl
:
fo
.
write
(
'
:ref:`
%
s`
\n
\n
'
%
self
.
rstlbl
)
fo
.
write
(
' :ref:`
%
s`
\n
\n
'
%
self
.
rstlbl
)
def
cstuff
(
self
,
unused_fo
,
unused_where
):
return
...
...
@@ -556,10 +556,7 @@ class ModuleStanza(Stanza):
else
:
print
(
"
\n
NOTICE: Please put $Module description in quotes.
\n
"
)
self
.
vcc
.
moddesc
=
" "
.
join
(
self
.
toks
[
3
:])
self
.
rstlbl
=
"vmod_
%
s(
%
s)"
%
(
self
.
vcc
.
modname
,
self
.
vcc
.
mansection
)
self
.
rstlbl
=
"vmod_
%
s(
%
d)"
%
(
self
.
vcc
.
modname
,
3
)
self
.
vcc
.
contents
.
append
(
self
)
def
rsthead
(
self
,
fo
,
man
):
...
...
@@ -570,6 +567,8 @@ class ModuleStanza(Stanza):
fo
.
write
(
"
\n
"
)
fo
.
write
(
":Manual section: "
+
self
.
vcc
.
mansection
+
"
\n
"
)
else
:
if
self
.
rstlbl
:
fo
.
write
(
'
\n
.. _'
+
self
.
rstlbl
+
':
\n
'
)
write_rst_hdr
(
fo
,
self
.
vcc
.
sympfx
+
self
.
vcc
.
modname
+
' - '
+
self
.
vcc
.
moddesc
,
...
...
@@ -669,7 +668,7 @@ class FunctionStanza(Stanza):
def
parse
(
self
):
self
.
proto
=
ProtoType
(
self
)
self
.
rstlbl
=
"func_"
+
self
.
proto
.
name
self
.
rstlbl
=
'vmod_
%
s.
%
s'
%
(
self
.
vcc
.
modname
,
self
.
proto
.
name
)
self
.
vcc
.
contents
.
append
(
self
)
def
cstuff
(
self
,
fo
,
where
):
...
...
@@ -702,12 +701,14 @@ class ObjectStanza(Stanza):
self
.
fini
.
argstruct
=
False
self
.
fini
.
args
=
[]
self
.
rstlbl
=
"obj_"
+
self
.
proto
.
name
self
.
rstlbl
=
'vmod_
%
s.
%
s'
%
(
self
.
vcc
.
modname
,
self
.
proto
.
name
)
self
.
vcc
.
contents
.
append
(
self
)
self
.
methods
=
[]
def
rsthead
(
self
,
fo
,
man
):
self
.
proto
.
rsthead
(
fo
)
if
self
.
rstlbl
:
fo
.
write
(
'
\n
.. _'
+
self
.
rstlbl
+
':
\n
'
)
self
.
proto
.
rst_proto
(
fo
)
fo
.
write
(
"
\n
"
+
"
\n
"
.
join
(
self
.
doc
)
+
"
\n
"
)
for
i
in
self
.
methods
:
i
.
rstfile
(
fo
,
man
)
...
...
@@ -725,7 +726,7 @@ class ObjectStanza(Stanza):
fo
.
write
(
' :ref:`
%
s`
\n
\n
'
%
self
.
rstlbl
)
for
i
in
self
.
methods
:
if
i
.
proto
and
i
.
rstlbl
:
fo
.
write
(
' :ref:`
%
s`
\n
\n
'
%
i
.
rstlbl
)
fo
.
write
(
'
:ref:`
%
s`
\n
\n
'
%
i
.
rstlbl
)
def
cstuff
(
self
,
fo
,
w
):
sn
=
self
.
vcc
.
sympfx
+
self
.
vcc
.
modname
+
"_"
+
self
.
proto
.
name
...
...
@@ -787,7 +788,7 @@ class MethodStanza(Stanza):
err
(
"$Method
%
s: Method names need to start with . (dot)"
%
self
.
proto
.
bname
,
warn
=
False
)
self
.
proto
.
obj
=
"x"
+
self
.
pfx
self
.
rstlbl
=
"func_"
+
self
.
proto
.
name
self
.
rstlbl
=
'vmod_
%
s.
%
s'
%
(
self
.
vcc
.
modname
,
self
.
proto
.
name
)
p
.
methods
.
append
(
self
)
def
cstruct
(
self
,
fo
,
define
):
...
...
lib/libvmod_blob/vmod.vcc
View file @
c0903203
...
...
@@ -55,7 +55,7 @@ Examples::
}
ENCODING SCHEMES
================
----------------
Binary-to-text encoding schemes are specified by ENUMs in the VMOD's
constructor, methods and functions. Decodings convert a (possibly
...
...
@@ -91,7 +91,7 @@ case of a string, use the ``toupper`` or ``tolower`` functions from
:ref:`vmod_std(3)`.
IDENTITY
--------
~~~~~~~~
The simplest encoding converts between the BLOB and STRING data types,
leaving the contents byte-identical.
...
...
@@ -120,7 +120,7 @@ be written as::
The ``case`` ENUM MUST be set to ``DEFAULT`` for ``IDENTITY`` encodings.
BASE64*
-------
~~~~~~~
The base64 encoding schemes use 4 characters to encode 3 bytes. There
are no newlines or maximal line lengths -- whitespace is not
...
...
@@ -143,7 +143,7 @@ The ``case`` ENUM MUST be set to ``DEFAULT`` for for all of the
``BASE64*`` encodings.
HEX
---
~~~
The ``HEX`` encoding scheme converts hex strings into blobs and vice
versa. For encodings, you may use the ``case`` ENUM to specify upper-
...
...
@@ -164,7 +164,7 @@ byte. For example::
encoded=resp.http.First + resp.http.Second));
URL
---
~~~
The ``URL`` decoding replaces any ``%<2-hex-digits>`` substrings with
the binary value of the hexadecimal number after the % sign.
...
...
@@ -197,6 +197,7 @@ Example::
# convert string to blob
blob.decode(encoded="foo");
$Function STRING encode(ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD,
HEX, URL} encoding="IDENTITY",
ENUM {LOWER, UPPER, DEFAULT} case="DEFAULT", BLOB blob)
...
...
lib/libvmod_directors/vmod.vcc
View file @
c0903203
...
...
@@ -349,13 +349,13 @@ Set the default rampup duration. See `rampup` parameter of
$Method VOID .associate(BLOB param=0)
Associate a default `
obj_
shard_param`_ object or clear an association.
Associate a default `
vmod_directors.
shard_param`_ object or clear an association.
The value of the `param` argument must be a call to the
`
func_
shard_param.use`_ method. No argument clears the association.
`
vmod_directors.
shard_param.use`_ method. No argument clears the association.
The association can be changed per backend request using the `param`
argument of `
func_
shard.backend`_.
argument of `
vmod_directors.
shard.backend`_.
$Method BOOL .add_backend(PRIV_TASK, BACKEND backend,
[STRING ident], [DURATION rampup])
...
...
@@ -371,7 +371,7 @@ backend name.
`rampup`: Optionally specify a specific rampup time for this
backend. Otherwise, the per-director rampup time is used (see
:ref:`
func_
shard.set_rampup`).
:ref:`
vmod_directors.
shard.set_rampup`).
NOTE: Backend changes need to be finalized with `shard.reconfigure()`
and are only supported on one shard director at a time.
...
...
@@ -536,14 +536,14 @@ is _not_ the order given when backends are added.
* `param`
Use or associate a parameter set. The value of the `param` argument
must be a call to the `
func_
shard_param.use`_ method.
must be a call to the `
vmod_directors.
shard_param.use`_ method.
default: as set by `
func_
shard.associate`_ or unset.
default: as set by `
vmod_directors.
shard.associate`_ or unset.
* for ``resolve=NOW`` take parameter defaults from the
`
obj_
shard_param`_ parameter set
`
vmod_directors.
shard_param`_ parameter set
* for ``resolve=LAZY`` associate the `
obj_
shard_param`_ parameter
* for ``resolve=LAZY`` associate the `
vmod_directors.
shard_param`_ parameter
set for this backend request
Implementation notes for use of parameter sets with
...
...
@@ -557,7 +557,7 @@ is _not_ the order given when backends are added.
and are kept even if the parameter set given by the `param`
argument is subsequently changed within the same backend request.
* Each call to `
func_
shard.backend`_ overrides any previous call.
* Each call to `
vmod_directors.
shard.backend`_ overrides any previous call.
$Method VOID .debug(INT)
...
...
@@ -567,7 +567,7 @@ $Object shard_param()
Create a shard parameter set.
A parameter set allows for re-use of `
func_
shard.backend`_ arguments
A parameter set allows for re-use of `
vmod_directors.
shard.backend`_ arguments
across many shard director instances and simplifies advanced use cases
(e.g. shard director with custom parameters layered below other
directors).
...
...
@@ -586,7 +586,7 @@ Parameter sets can not be used in client context.
$Method VOID .clear()
Reset the parameter set to default values as documented for
`
func_
shard.backend`_.
`
vmod_directors.
shard.backend`_.
* in ``vcl_init{}``, resets the parameter set default for this VCL
* in backend context, resets the parameter set for this backend
...
...
@@ -604,7 +604,7 @@ $Method VOID .set(
[ ENUM {CHOSEN, IGNORE, ALL} healthy ])
Change the given parameters of a parameter set as documented for
`
func_
shard.backend`_.
`
vmod_directors.
shard.backend`_.
* in ``vcl_init{}``, changes the parameter set default for this VCL
...
...
@@ -618,39 +618,39 @@ $Method STRING .get_by()
Get a string representation of the `by` enum argument which denotes
how a shard director using this parameter object would derive the
shard key. See `
func_
shard.backend`_.
shard key. See `
vmod_directors.
shard.backend`_.
$Method INT .get_key()
Get the key which a shard director using this parameter object would
use. See `
func_
shard.backend`_.
use. See `
vmod_directors.
shard.backend`_.
$Method INT .get_alt()
Get the `alt` parameter which a shard director using this parameter
object would use. See `
func_
shard.backend`_.
object would use. See `
vmod_directors.
shard.backend`_.
$Method REAL .get_warmup()
Get the `warmup` parameter which a shard director using this parameter
object would use. See `
func_
shard.backend`_.
object would use. See `
vmod_directors.
shard.backend`_.
$Method BOOL .get_rampup()
Get the `rampup` parameter which a shard director using this parameter
object would use. See `
func_
shard.backend`_.
object would use. See `
vmod_directors.
shard.backend`_.
$Method STRING .get_healthy()
Get a string representation of the `healthy` enum argument which a
shard director using this parameter object would use. See
`
func_
shard.backend`_.
`
vmod_directors.
shard.backend`_.
$Method BLOB .use()
This method may only be used in backend context.
For use with the `param` argument of `
func_
shard.backend`_ to associate
For use with the `param` argument of `
vmod_directors.
shard.backend`_ to associate
this shard parameter set with a shard director.
ACKNOWLEDGEMENTS
...
...
lib/libvmod_std/vmod.vcc
View file @
c0903203
...
...
@@ -214,7 +214,7 @@ $Function TIME real2time(REAL r, TIME fallback)
Description
Rounds the real *r* to the nearest integer (see
`
func_
real2integer`_) and returns the corresponding time when
`
vmod_std.
real2integer`_) and returns the corresponding time when
interpreted as a unix epoch. If conversion fails, *fallback*
will be returned.
Example
...
...
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