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
d54e1ec9
Commit
d54e1ec9
authored
Apr 22, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass a busyobj * to the VCL methods
parent
765139fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
cache_vcl.c
bin/varnishd/cache/cache_vcl.c
+6
-5
generate.py
lib/libvcl/generate.py
+3
-1
vcc_compile.c
lib/libvcl/vcc_compile.c
+1
-1
No files found.
bin/varnishd/cache/cache_vcl.c
View file @
d54e1ec9
...
...
@@ -191,7 +191,7 @@ VCL_Load(const char *fn, const char *name, struct cli *cli)
REPLACE
(
vcl
->
name
,
name
);
VCLI_Out
(
cli
,
"Loaded
\"
%s
\"
as
\"
%s
\"
"
,
fn
,
name
);
VTAILQ_INSERT_TAIL
(
&
vcl_head
,
vcl
,
list
);
(
void
)
vcl
->
conf
->
init_func
(
NULL
,
NULL
,
NULL
);
(
void
)
vcl
->
conf
->
init_func
(
NULL
,
NULL
,
NULL
,
NULL
);
Lck_Lock
(
&
vcl_mtx
);
if
(
vcl_active
==
NULL
)
vcl_active
=
vcl
;
...
...
@@ -215,7 +215,7 @@ VCL_Nuke(struct vcls *vcl)
assert
(
vcl
->
conf
->
discard
);
assert
(
vcl
->
conf
->
busy
==
0
);
VTAILQ_REMOVE
(
&
vcl_head
,
vcl
,
list
);
(
void
)
vcl
->
conf
->
fini_func
(
NULL
,
NULL
,
NULL
);
(
void
)
vcl
->
conf
->
fini_func
(
NULL
,
NULL
,
NULL
,
NULL
);
vcl
->
conf
->
fini_vcl
(
NULL
);
free
(
vcl
->
name
);
(
void
)
dlclose
(
vcl
->
dlh
);
...
...
@@ -340,20 +340,21 @@ VCL_##func##_method(struct worker *wrk, struct req *req, struct ws *ws) \
{ \
char *aws; \
\
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); \
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); \
CHECK_OBJ_NOTNULL(req->sp, SESS_MAGIC); \
AN(req->sp); \
aws = WS_Snapshot(
req->wrk->aws);
\
aws = WS_Snapshot(
wrk->aws);
\
req->handling = 0; \
req->cur_method = VCL_MET_ ## upper; \
VSLb(req->vsl, SLT_VCL_call, "%s", #func); \
(void)req->vcl->func##_func(wrk, req,
ws);
\
(void)req->vcl->func##_func(wrk, req,
NULL, ws);
\
VSLb(req->vsl, SLT_VCL_return, "%s", \
VCL_Return_Name(req->handling)); \
req->cur_method = 0; \
assert((1U << req->handling) & bitmap); \
assert(!((1U << req->handling) & ~bitmap)); \
WS_Reset(
req->
wrk->aws, aws); \
WS_Reset(wrk->aws, aws); \
}
#include "tbl/vcl_returns.h"
...
...
lib/libvcl/generate.py
View file @
d54e1ec9
...
...
@@ -745,13 +745,15 @@ file_header(fo)
fo
.
write
(
"""
struct sess;
struct req;
struct busyobj;
struct ws;
struct cli;
struct worker;
typedef int vcl_init_f(struct cli *);
typedef void vcl_fini_f(struct cli *);
typedef int vcl_func_f(struct worker *, struct req *, struct ws *);
typedef int vcl_func_f(struct worker *, struct req *, struct busyobj *,
struct ws *);
"""
)
...
...
lib/libvcl/vcc_compile.c
View file @
d54e1ec9
...
...
@@ -694,7 +694,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
Fc
(
tl
,
1
,
"
\n
static int __match_proto__(vcl_func_f)
\n
"
);
Fc
(
tl
,
1
,
"VGC_function_%s(struct worker *wrk,"
" struct req *req, struct ws *ws)
\n
"
,
" struct req *req, struct
busyobj *bo, struct
ws *ws)
\n
"
,
method_tab
[
i
].
name
);
AZ
(
VSB_finish
(
tl
->
fm
[
i
]));
Fc
(
tl
,
1
,
"{
\n
"
);
...
...
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