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
ab1eca8c
Unverified
Commit
ab1eca8c
authored
Oct 28, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vmod_debug: Add a VDP to allocate the thread_workspace
parent
0883512e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
vmod_debug_filters.c
vmod/vmod_debug_filters.c
+37
-0
No files found.
vmod/vmod_debug_filters.c
View file @
ab1eca8c
...
...
@@ -630,6 +630,41 @@ xyzzy_chkcrc32(VRT_CTX, VCL_INT expected, VCL_ENUM mode_e)
cfg
->
expected
=
(
uintmax_t
)
expected
%
UINT32_MAX
;
}
/**********************************************************************
* reserve thread_workspace
*/
static
int
v_matchproto_
(
vdp_init_f
)
xyzzy_awshog_init
(
VRT_CTX
,
struct
vdp_ctx
*
vdc
,
void
**
priv
)
{
struct
ws
*
aws
;
unsigned
u
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
CHECK_OBJ_ORNULL
(
vdc
->
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
vdc
->
hp
,
HTTP_MAGIC
);
AN
(
vdc
->
clen
);
AN
(
priv
);
if
(
ctx
->
req
!=
NULL
)
aws
=
ctx
->
req
->
wrk
->
aws
;
else
if
(
ctx
->
bo
!=
NULL
)
aws
=
ctx
->
bo
->
wrk
->
aws
;
else
WRONG
(
"neither req nor bo"
);
u
=
WS_ReserveAll
(
aws
);
WS_Release
(
aws
,
0
);
(
void
)
WS_Alloc
(
aws
,
u
);
return
(
1
);
}
static
const
struct
vdp
xyzzy_vdp_awshog
=
{
.
name
=
"debug.awshog"
,
.
init
=
xyzzy_awshog_init
};
void
debug_add_filters
(
VRT_CTX
)
{
...
...
@@ -639,6 +674,7 @@ debug_add_filters(VRT_CTX)
AZ
(
VRT_AddFilter
(
ctx
,
&
xyzzy_vfp_slow
,
&
xyzzy_vdp_slow
));
AZ
(
VRT_AddFilter
(
ctx
,
NULL
,
&
xyzzy_vdp_chksha256
));
AZ
(
VRT_AddFilter
(
ctx
,
NULL
,
&
xyzzy_vdp_chkcrc32
));
AZ
(
VRT_AddFilter
(
ctx
,
NULL
,
&
xyzzy_vdp_awshog
));
}
void
...
...
@@ -650,4 +686,5 @@ debug_remove_filters(VRT_CTX)
VRT_RemoveFilter
(
ctx
,
NULL
,
&
xyzzy_vdp_chunked
);
VRT_RemoveFilter
(
ctx
,
NULL
,
&
xyzzy_vdp_chksha256
);
VRT_RemoveFilter
(
ctx
,
NULL
,
&
xyzzy_vdp_chkcrc32
);
VRT_RemoveFilter
(
ctx
,
NULL
,
&
xyzzy_vdp_awshog
);
}
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