Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-hoailona
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-hoailona
Commits
478bdeb9
Commit
478bdeb9
authored
Mar 13, 2019
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use VRT_fail to fail from housekeeping subs (vcl_init/vcl_fini)
parent
c8358237
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
26 deletions
+15
-26
vmod_hoailona.c
src/vmod_hoailona.c
+15
-26
No files found.
src/vmod_hoailona.c
View file @
478bdeb9
...
...
@@ -35,11 +35,21 @@
#include "vas.h"
#include "vcc_if.h"
#define ERR(ctx, msg) \
errmsg((ctx), "vmod hoailona error: " msg)
#define VERR(ctx, fmt, ...) \
errmsg((ctx), "vmod hoailona error: " fmt, __VA_ARGS__)
#define epfx "vmod hoailona error: "
#define ERR(ctx, msg) do { \
if (ctx->method & VCL_MET_TASK_H) \
VRT_fail(ctx, epfx msg); \
else \
VSLb(ctx->vsl, SLT_VCL_Error, epfx msg); \
} while(0)
#define VERR(ctx, fmt, ...) do { \
if (ctx->method & VCL_MET_TASK_H) \
VRT_fail(ctx, epfx fmt, __VA_ARGS__); \
else \
VSLb(ctx->vsl, SLT_VCL_Error, epfx fmt, __VA_ARGS__); \
} while(0)
#define VERRNOMEM(ctx, fmt, ...) \
VERR((ctx), fmt ", out of space", __VA_ARGS__)
...
...
@@ -98,27 +108,6 @@ get_policy(VRT_CTX, const struct vmod_priv * restrict const,
const
char
*
restrict
const
,
const
char
*
restrict
const
);
void
errmsg
(
VRT_CTX
,
const
char
*
fmt
,
...)
{
va_list
args
;
va_start
(
args
,
fmt
);
if
(
ctx
->
vsl
)
VSLbv
(
ctx
->
vsl
,
SLT_VCL_Error
,
fmt
,
args
);
else
VSLv
(
SLT_VCL_Error
,
0
,
fmt
,
args
);
va_end
(
args
);
if
(
ctx
->
method
==
VCL_MET_INIT
)
{
AN
(
ctx
->
msg
);
va_start
(
args
,
fmt
);
VSB_vprintf
(
ctx
->
msg
,
fmt
,
args
);
va_end
(
args
);
VRT_handling
(
ctx
,
VCL_RET_FAIL
);
}
}
/* Event function */
int
v_matchproto_
(
vmod_event_f
)
...
...
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