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
1473576f
Commit
1473576f
authored
Sep 23, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace OCD
parent
4b857004
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
20 deletions
+19
-20
vmod.vcc
lib/libvmod_directors/vmod.vcc
+9
-9
vmod.vcc
lib/libvmod_std/vmod.vcc
+6
-6
vmod_std.c
lib/libvmod_std/vmod_std.c
+4
-5
No files found.
lib/libvmod_directors/vmod.vcc
View file @
1473576f
...
...
@@ -47,9 +47,9 @@ want to emulate the previous behavior of Varnish 3.0 you can just
initialize the directors in vcl_init, like this:::
sub vcl_init {
new vdir = directors.round_robin();
vdir.add_backend(backend1);
vdir.add_backend(backend2);
new vdir = directors.round_robin();
vdir.add_backend(backend1);
vdir.add_backend(backend2);
}
As you can see there is nothing keeping you from manipulating the
...
...
@@ -61,7 +61,7 @@ Note that directors can use other directors as backends.
$Object round_robin()
Description
Create a round robin director.
Create a round robin director.
This director will pick backends in a round robin fashion.
Example
...
...
@@ -86,18 +86,18 @@ Example
$Object fallback()
Description
Create a fallback director.
Create a fallback director.
A fallback director will try each of the added backends in turn,
and return the first one that is healthy.
A fallback director will try each of the added backends in turn,
and return the first one that is healthy.
Example
new vdir = directors.fallback();
new vdir = directors.fallback();
$Method VOID .add_backend(BACKEND)
Description
Add a backend to the director.
Add a backend to the director.
Note that the order in which this is done matters for the fallback
director.
...
...
lib/libvmod_std/vmod.vcc
View file @
1473576f
...
...
@@ -194,9 +194,9 @@ Example
$Function STRING querysort(STRING)
Description
Sorts the querystring for cache normalization purposes.
Sorts the querystring for cache normalization purposes.
Example
set req.url = std.querysort(req.url);
set req.url = std.querysort(req.url);
$Function VOID cache_req_body(BYTES)
...
...
@@ -214,12 +214,12 @@ Description
string. Note that the comparison is case sensitive. You can
use the tolower function on both strings if you want case
insensitivity.
If there is no match a NULL pointer is returned which would
evaluate to false in an if-test.
If there is no match a NULL pointer is returned which would
evaluate to false in an if-test.
Example
if (std.strstr(req.url, req.http.x-restrict))
if (std.strstr(req.url, req.http.x-restrict))
...
...
lib/libvmod_std/vmod_std.c
View file @
1473576f
...
...
@@ -242,12 +242,11 @@ vmod_cache_req_body(const struct vrt_ctx *ctx, VCL_BYTES size)
VCL_STRING
__match_proto__
(
td_std_strstr
)
vmod_strstr
(
const
struct
vrt_ctx
*
ctx
,
VCL_STRING
mstr
,
VCL_STRING
msubstr
)
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
((
mstr
==
NULL
)
||
(
msubstr
==
NULL
))
if
((
mstr
==
NULL
)
||
(
msubstr
==
NULL
))
return
(
NULL
);
else
return
(
strstr
(
mstr
,
msubstr
));
return
(
strstr
(
mstr
,
msubstr
));
}
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