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
967af895
Commit
967af895
authored
Jun 14, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass struct req into VCL methods
parent
3cea8945
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
cache_vcl.c
bin/varnishd/cache/cache_vcl.c
+3
-3
generate.py
lib/libvcl/generate.py
+2
-1
vcc_compile.c
lib/libvcl/vcc_compile.c
+1
-1
vcc_parse.c
lib/libvcl/vcc_parse.c
+5
-2
No files found.
bin/varnishd/cache/cache_vcl.c
View file @
967af895
...
...
@@ -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
);
(
void
)
vcl
->
conf
->
init_func
(
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
);
(
void
)
vcl
->
conf
->
fini_func
(
NULL
,
NULL
);
vcl
->
conf
->
fini_vcl
(
NULL
);
free
(
vcl
->
name
);
(
void
)
dlclose
(
vcl
->
dlh
);
...
...
@@ -344,7 +344,7 @@ VCL_##func##_method(struct req *req) \
req->handling = 0; \
req->cur_method = VCL_MET_ ## upper; \
VSLb(req->vsl, SLT_VCL_call, "%s", #func); \
(void)req->vcl->func##_func(req->sp
);
\
(void)req->vcl->func##_func(req->sp
, req);
\
VSLb(req->vsl, SLT_VCL_return, "%s", \
VCL_Return_Name(req->handling)); \
req->cur_method = 0; \
...
...
lib/libvcl/generate.py
View file @
967af895
...
...
@@ -716,11 +716,12 @@ file_header(fo)
fo
.
write
(
"""
struct sess;
struct req;
struct cli;
typedef int vcl_init_f(struct cli *);
typedef void vcl_fini_f(struct cli *);
typedef int vcl_func_f(struct sess *sp);
typedef int vcl_func_f(struct sess *sp
, struct req *req
);
"""
)
...
...
lib/libvcl/vcc_compile.c
View file @
967af895
...
...
@@ -670,7 +670,7 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp)
/* Emit method functions */
for
(
i
=
0
;
i
<
VCL_MET_MAX
;
i
++
)
{
Fc
(
tl
,
1
,
"
\n
static int
\n
"
);
Fc
(
tl
,
1
,
"VGC_function_%s
(struct sess *sp
)
\n
"
,
Fc
(
tl
,
1
,
"VGC_function_%s
(struct sess *sp, struct req *req
)
\n
"
,
method_tab
[
i
].
name
);
AZ
(
VSB_finish
(
tl
->
fm
[
i
]));
Fc
(
tl
,
1
,
"{
\n
"
);
...
...
lib/libvcl/vcc_parse.c
View file @
967af895
...
...
@@ -224,10 +224,13 @@ vcc_Function(struct vcc *tl)
return
;
}
tl
->
curproc
=
vcc_AddProc
(
tl
,
tl
->
t
);
Fh
(
tl
,
0
,
"static int VGC_function_%.*s (struct sess *sp);
\n
"
,
Fh
(
tl
,
0
,
"static int VGC_function_%.*s "
"(struct sess *, struct req *);
\n
"
,
PF
(
tl
->
t
));
Fc
(
tl
,
1
,
"
\n
static int
\n
"
);
Fc
(
tl
,
1
,
"VGC_function_%.*s (struct sess *sp)
\n
"
,
PF
(
tl
->
t
));
Fc
(
tl
,
1
,
"VGC_function_%.*s"
"(struct sess *sp, struct req *req)
\n
"
,
PF
(
tl
->
t
));
}
vcc_NextToken
(
tl
);
tl
->
indent
+=
INDENT
;
...
...
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