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
686b530d
Commit
686b530d
authored
Feb 18, 2020
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid a potential PRIV_TASK collision in vmod_debug
You never know what the next test case will look like...
parent
044809d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
vmod.vcc
lib/libvmod_debug/vmod.vcc
+2
-2
vmod_debug.c
lib/libvmod_debug/vmod_debug.c
+13
-5
No files found.
lib/libvmod_debug/vmod.vcc
View file @
686b530d
...
...
@@ -269,12 +269,12 @@ Set the client socket' send buffer size to *sndbuf*. The previous, desired
and actual values appear in the logs. Not currently implemented for backend
transactions.
$Function VOID store_ip(
PRIV_TASK,
IP)
$Function VOID store_ip(IP)
Store an IP address to be later found by ``debug.get_ip()`` in the same
transaction.
$Function IP get_ip(
PRIV_TASK
)
$Function IP get_ip()
Get the IP address previously stored by ``debug.store_ip()`` in the same
transaction.
...
...
lib/libvmod_debug/vmod_debug.c
View file @
686b530d
...
...
@@ -922,29 +922,37 @@ xyzzy_sndbuf(VRT_CTX, VCL_BYTES arg)
}
VCL_VOID
xyzzy_store_ip
(
VRT_CTX
,
struct
vmod_priv
*
priv
,
VCL_IP
ip
)
xyzzy_store_ip
(
VRT_CTX
,
VCL_IP
ip
)
{
struct
vmod_priv
*
priv
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
AN
(
priv
);
priv
=
VRT_priv_task
(
ctx
,
xyzzy_store_ip
);
if
(
priv
==
NULL
)
{
VRT_fail
(
ctx
,
"no priv task - out of ws?"
);
return
;
}
AZ
(
priv
->
free
);
assert
(
VSA_Sane
(
ip
));
priv
->
priv
=
TRUST_ME
(
ip
);
}
VCL_IP
xyzzy_get_ip
(
VRT_CTX
,
struct
vmod_priv
*
priv
)
xyzzy_get_ip
(
VRT_CTX
)
{
struct
vmod_priv
*
priv
;
VCL_IP
ip
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
priv
=
VRT_priv_task
(
ctx
,
xyzzy_store_ip
);
AN
(
priv
);
AZ
(
priv
->
free
);
ip
=
priv
->
priv
;
assert
(
VSA_Sane
(
ip
));
return
(
ip
);
}
...
...
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