Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-vtstor
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-vtstor
Commits
e8c64b5b
Commit
e8c64b5b
authored
May 22, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store() method emits and error to the log and returns if the string
to be stored is NULL
parent
41abcb92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
b03.vtc
src/tests/b03.vtc
+29
-0
vmod_vtstor.c
src/vmod_vtstor.c
+6
-0
No files found.
src/tests/b03.vtc
0 → 100644
View file @
e8c64b5b
varnishtest "vtstor-vmod: test error handling"
server s1 {} -start
varnish v1 -vcl+backend {
import vtstor from "${vmod_topbuild}/src/.libs/libvmod_vtstor.so";
import std;
sub vcl_init {
new zero = vtstor.vtstor(0, 0, 0, 0);
}
sub vcl_recv {
zero.store(req.http.Foo, req.http.Bar);
return(synth(200, "OK"));
}
} -start
client c1 {
txreq -hdr "Bar: baz"
rxresp
expect resp.status == 200
} -run
logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
expect 0 * Begin req
expect * = VCL_Error ^vmod vtstor: store() method called with NULL string$
expect * = End
} -run
src/vmod_vtstor.c
View file @
e8c64b5b
...
@@ -114,6 +114,12 @@ vmod_vtstor_store(VRT_CTX, struct vmod_vtstor_vtstor *vmi,
...
@@ -114,6 +114,12 @@ vmod_vtstor_store(VRT_CTX, struct vmod_vtstor_vtstor *vmi,
AN
(
hdr
);
AN
(
hdr
);
AN
(
hdr
->
what
);
AN
(
hdr
->
what
);
if
(
s
==
NULL
)
{
VSLb
(
ctx
->
vsl
,
SLT_VCL_Error
,
"vmod vtstor: store() method called with NULL string"
);
return
;
}
hp
=
selecthttp
(
ctx
,
hdr
->
where
);
hp
=
selecthttp
(
ctx
,
hdr
->
where
);
CHECK_OBJ_NOTNULL
(
hp
,
HTTP_MAGIC
);
CHECK_OBJ_NOTNULL
(
hp
,
HTTP_MAGIC
);
...
...
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