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
c8485f8d
Commit
c8485f8d
authored
Sep 22, 2014
by
Per Buer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nitpicks
parent
5aa97f16
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
vmod.vcc
lib/libvmod_std/vmod.vcc
+5
-1
vmod_std.c
lib/libvmod_std/vmod_std.c
+5
-4
No files found.
lib/libvmod_std/vmod.vcc
View file @
c8485f8d
...
@@ -210,10 +210,14 @@ Example
...
@@ -210,10 +210,14 @@ Example
$Function STRING strstr(STRING, STRING)
$Function STRING strstr(STRING, STRING)
Description
Description
Returns t
rue
if the second string is a substring of the first
Returns t
he substring
if the second string is a substring of the first
string. Note that the comparison is case sensitive. You can
string. Note that the comparison is case sensitive. You can
use the tolower function on both strings if you want case
use the tolower function on both strings if you want case
insensitivity.
insensitivity.
If there is no match a NULL pointer is returned which would
evaluate to false in an if-test.
Example
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 @
c8485f8d
...
@@ -243,10 +243,11 @@ vmod_cache_req_body(const struct vrt_ctx *ctx, VCL_BYTES size)
...
@@ -243,10 +243,11 @@ vmod_cache_req_body(const struct vrt_ctx *ctx, VCL_BYTES size)
VCL_STRING
__match_proto__
(
td_std_strstr
)
VCL_STRING
__match_proto__
(
td_std_strstr
)
vmod_strstr
(
const
struct
vrt_ctx
*
ctx
,
VCL_STRING
mstr
,
VCL_STRING
msubstr
)
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
);
char
*
match
=
strstr
(
mstr
,
msubstr
);
return
(
match
);
if
((
mstr
==
NULL
)
||
(
msubstr
==
NULL
))
return
(
NULL
);
else
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