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
fd9e40db
Commit
fd9e40db
authored
Jan 31, 2019
by
Guillaume Quintard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stricter magic checks
parent
b23dddd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
10 deletions
+33
-10
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+28
-8
vmod_unix.c
lib/libvmod_unix/vmod_unix.c
+5
-2
No files found.
bin/varnishd/cache/cache_vrt_var.c
View file @
fd9e40db
...
...
@@ -429,6 +429,10 @@ VRT_r_obj_storage(VRT_CTX)
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
->
objcore
,
OBJCORE_MAGIC
);
AN
(
ctx
->
req
->
objcore
->
stobj
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
->
objcore
->
stobj
->
stevedore
,
STEVEDORE_MAGIC
);
return
(
ctx
->
req
->
objcore
->
stobj
->
stevedore
);
}
...
...
@@ -673,6 +677,8 @@ VRT_r_req_xid(VRT_CTX)
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
->
http
,
HTTP_MAGIC
);
AN
(
ctx
->
req
->
vsl
);
return
(
WS_Printf
(
ctx
->
req
->
http
->
ws
,
"%u"
,
VXID
(
ctx
->
req
->
vsl
->
wid
)));
...
...
@@ -684,6 +690,8 @@ VRT_r_bereq_xid(VRT_CTX)
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
bo
->
bereq
,
HTTP_MAGIC
);
AN
(
ctx
->
bo
->
vsl
);
return
(
WS_Printf
(
ctx
->
bo
->
bereq
->
ws
,
"%u"
,
VXID
(
ctx
->
bo
->
vsl
->
wid
)));
...
...
@@ -692,15 +700,26 @@ VRT_r_bereq_xid(VRT_CTX)
VCL_STRING
VRT_r_sess_xid
(
VRT_CTX
)
{
struct
sess
*
sp
;
struct
http
*
http
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
(
VALID_OBJ
(
ctx
->
req
,
REQ_MAGIC
))
return
(
WS_Printf
(
ctx
->
req
->
http
->
ws
,
"%u"
,
VXID
(
ctx
->
req
->
sp
->
vxid
)));
if
(
ctx
->
req
)
{
CHECK_OBJ
(
ctx
->
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
->
http
,
HTTP_MAGIC
);
sp
=
ctx
->
req
->
sp
;
http
=
ctx
->
req
->
http
;
}
else
{
CHECK_OBJ_NOTNULL
(
ctx
->
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
bo
->
bereq
,
HTTP_MAGIC
);
sp
=
ctx
->
bo
->
sp
;
http
=
ctx
->
bo
->
bereq
;
}
CHECK_OBJ_NOTNULL
(
ctx
->
bo
,
BUSYOBJ
_MAGIC
);
return
(
WS_Printf
(
ctx
->
bo
->
bereq
->
ws
,
"%u"
,
VXID
(
ctx
->
bo
->
sp
->
vxid
)));
CHECK_OBJ_NOTNULL
(
http
,
HTTP
_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
return
(
WS_Printf
(
http
->
ws
,
"%u"
,
VXID
(
sp
->
vxid
)));
}
/*--------------------------------------------------------------------
...
...
@@ -763,9 +782,10 @@ VRT_r_local_##var(VRT_CTX) \
struct sess *sp; \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
if (VALID_OBJ(ctx->req, REQ_MAGIC)) \
if (ctx->req) { \
CHECK_OBJ(ctx->req, REQ_MAGIC); \
sp = ctx->req->sp; \
else {
\
} else {
\
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC); \
sp = ctx->bo->sp; \
} \
...
...
lib/libvmod_unix/vmod_unix.c
View file @
fd9e40db
...
...
@@ -67,9 +67,12 @@ get_sp(VRT_CTX)
{
struct
sess
*
sp
;
if
(
VALID_OBJ
(
ctx
->
req
,
REQ_MAGIC
))
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
(
ctx
->
req
)
{
CHECK_OBJ
(
ctx
->
req
,
REQ_MAGIC
);
sp
=
ctx
->
req
->
sp
;
else
{
}
else
{
CHECK_OBJ_NOTNULL
(
ctx
->
bo
,
BUSYOBJ_MAGIC
);
sp
=
ctx
->
bo
->
sp
;
}
...
...
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