Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-file
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-file
Commits
38f67414
Commit
38f67414
authored
Sep 21, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add reader.errmsg().
parent
0f24c22a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
2 deletions
+39
-2
README.rst
README.rst
+11
-0
errors.vtc
src/tests/errors.vtc
+10
-2
vmod_file.c
src/vmod_file.c
+10
-0
vmod_file.vcc
src/vmod_file.vcc
+8
-0
No files found.
README.rst
View file @
38f67414
...
...
@@ -87,6 +87,17 @@ time the file was checked.
XXX ...
.. _xreader.errmsg():
STRING xreader.errmsg()
-----------------------
Returns the error message for any error condition determined the last
time the file was checked, or a message indicating that there was no
error.
XXX ...
.. _file.version():
STRING version()
...
...
src/tests/errors.vtc
View file @
38f67414
...
...
@@ -2,7 +2,7 @@
varnishtest "reader.error()"
shell {
echo -n "foo bar baz quux" >
${tmpdir}/error}
shell {
touch
${tmpdir}/error}
varnish v1 -vcl {
import ${vmod_file};
...
...
@@ -18,6 +18,7 @@ varnish v1 -vcl {
sub vcl_synth {
set resp.http.Error = rdr.error();
set resp.http.Errmsg = rdr.errmsg();
return (deliver);
}
} -start
...
...
@@ -27,14 +28,21 @@ client c1 {
rxresp
expect resp.status == 200
expect resp.http.Error == "false"
expect resp.http.Errmsg == "No error"
} -run
shell {rm -f ${tmpdir}/error}
delay .1
client c
1
{
client c
2
{
txreq
rxresp
expect resp.status == 200
expect resp.http.Error == "true"
expect resp.http.Errmsg ~ "^vmod file failure: rdr: cannot read info about"
} -run
shell {touch ${tmpdir}/error}
delay .1
client c1 -run
src/vmod_file.c
View file @
38f67414
...
...
@@ -514,6 +514,16 @@ vmod_reader_error(VRT_CTX, struct VPFX(file_reader) *rdr)
return
(
rdr
->
flags
&
RDR_ERROR
);
}
VCL_STRING
vmod_reader_errmsg
(
VRT_CTX
,
struct
VPFX
(
file_reader
)
*
rdr
)
{
CHECK_OBJ_NOTNULL
(
rdr
,
FILE_READER_MAGIC
);
(
void
)
ctx
;
AN
(
rdr
->
errbuf
);
return
(
rdr
->
errbuf
);
}
VCL_STRING
vmod_version
(
VRT_CTX
)
{
...
...
src/vmod_file.vcc
View file @
38f67414
...
...
@@ -64,6 +64,14 @@ time the file was checked.
XXX ...
$Method STRING .errmsg()
Returns the error message for any error condition determined the last
time the file was checked, or a message indicating that there was no
error.
XXX ...
$Function STRING version()
Return the version string for this VMOD.
...
...
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