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
9bba6622
Commit
9bba6622
authored
Feb 13, 2020
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
centralize setting ctx->syntax
... and ensure it always gets set during cli operations also
parent
c67af5f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
cache_vcl.c
bin/varnishd/cache/cache_vcl.c
+5
-0
cache_vrt_vcl.c
bin/varnishd/cache/cache_vrt_vcl.c
+0
-1
No files found.
bin/varnishd/cache/cache_vcl.c
View file @
9bba6622
...
@@ -83,6 +83,7 @@ VCL_Bo2Ctx(struct vrt_ctx *ctx, struct busyobj *bo)
...
@@ -83,6 +83,7 @@ VCL_Bo2Ctx(struct vrt_ctx *ctx, struct busyobj *bo)
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
wrk
,
WORKER_MAGIC
);
ctx
->
vcl
=
bo
->
vcl
;
ctx
->
vcl
=
bo
->
vcl
;
ctx
->
syntax
=
ctx
->
vcl
->
conf
->
syntax
;
ctx
->
vsl
=
bo
->
vsl
;
ctx
->
vsl
=
bo
->
vsl
;
ctx
->
http_bereq
=
bo
->
bereq
;
ctx
->
http_bereq
=
bo
->
bereq
;
ctx
->
http_beresp
=
bo
->
beresp
;
ctx
->
http_beresp
=
bo
->
beresp
;
...
@@ -102,6 +103,7 @@ VCL_Req2Ctx(struct vrt_ctx *ctx, struct req *req)
...
@@ -102,6 +103,7 @@ VCL_Req2Ctx(struct vrt_ctx *ctx, struct req *req)
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
ctx
->
vcl
=
req
->
vcl
;
ctx
->
vcl
=
req
->
vcl
;
ctx
->
syntax
=
ctx
->
vcl
->
conf
->
syntax
;
ctx
->
vsl
=
req
->
vsl
;
ctx
->
vsl
=
req
->
vsl
;
ctx
->
http_req
=
req
->
http
;
ctx
->
http_req
=
req
->
http
;
CHECK_OBJ_NOTNULL
(
req
->
top
,
REQTOP_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
top
,
REQTOP_MAGIC
);
...
@@ -586,6 +588,7 @@ vcl_cancel_load(struct vrt_ctx *ctx, struct cli *cli,
...
@@ -586,6 +588,7 @@ vcl_cancel_load(struct vrt_ctx *ctx, struct cli *cli,
ctx
=
VCL_Get_CliCtx
(
0
);
ctx
=
VCL_Get_CliCtx
(
0
);
ctx
->
vcl
=
vcl
;
ctx
->
vcl
=
vcl
;
ctx
->
method
=
VCL_MET_FINI
;
ctx
->
method
=
VCL_MET_FINI
;
ctx
->
syntax
=
ctx
->
vcl
->
conf
->
syntax
;
AZ
(
vcl_send_event
(
ctx
,
VCL_EVENT_DISCARD
));
AZ
(
vcl_send_event
(
ctx
,
VCL_EVENT_DISCARD
));
ctx
->
method
=
0
;
ctx
->
method
=
0
;
vcl_KillBackends
(
vcl
);
vcl_KillBackends
(
vcl
);
...
@@ -623,6 +626,7 @@ vcl_load(struct cli *cli, struct vrt_ctx *ctx,
...
@@ -623,6 +626,7 @@ vcl_load(struct cli *cli, struct vrt_ctx *ctx,
vcl
->
temp
=
VCL_TEMP_INIT
;
vcl
->
temp
=
VCL_TEMP_INIT
;
ctx
->
vcl
=
vcl
;
ctx
->
vcl
=
vcl
;
ctx
->
syntax
=
ctx
->
vcl
->
conf
->
syntax
;
VSB_clear
(
ctx
->
msg
);
VSB_clear
(
ctx
->
msg
);
ctx
->
method
=
VCL_MET_INIT
;
ctx
->
method
=
VCL_MET_INIT
;
...
@@ -801,6 +805,7 @@ vcl_cli_state(struct cli *cli, const char * const *av, void *priv)
...
@@ -801,6 +805,7 @@ vcl_cli_state(struct cli *cli, const char * const *av, void *priv)
ctx
=
VCL_Get_CliCtx
(
1
);
ctx
=
VCL_Get_CliCtx
(
1
);
ctx
->
vcl
=
vcl_find
(
av
[
2
]);
ctx
->
vcl
=
vcl_find
(
av
[
2
]);
AN
(
ctx
->
vcl
);
AN
(
ctx
->
vcl
);
ctx
->
syntax
=
ctx
->
vcl
->
conf
->
syntax
;
if
(
vcl_set_state
(
ctx
,
av
[
3
]))
{
if
(
vcl_set_state
(
ctx
,
av
[
3
]))
{
AZ
(
VSB_finish
(
ctx
->
msg
));
AZ
(
VSB_finish
(
ctx
->
msg
));
VCLI_SetResult
(
cli
,
CLIS_CANT
);
VCLI_SetResult
(
cli
,
CLIS_CANT
);
...
...
bin/varnishd/cache/cache_vrt_vcl.c
View file @
9bba6622
...
@@ -442,7 +442,6 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
...
@@ -442,7 +442,6 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
VCL_Bo2Ctx
(
&
ctx
,
bo
);
VCL_Bo2Ctx
(
&
ctx
,
bo
);
}
}
assert
(
ctx
.
now
!=
0
);
assert
(
ctx
.
now
!=
0
);
ctx
.
syntax
=
ctx
.
vcl
->
conf
->
syntax
;
ctx
.
specific
=
specific
;
ctx
.
specific
=
specific
;
ctx
.
method
=
method
;
ctx
.
method
=
method
;
aws
=
WS_Snapshot
(
wrk
->
aws
);
aws
=
WS_Snapshot
(
wrk
->
aws
);
...
...
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