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
0a4884c6
Unverified
Commit
0a4884c6
authored
Jun 02, 2021
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VRT_blob() to return vrt_null_blob for empty blobs
parent
48b9d1bf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+3
-0
vrt.h
include/vrt.h
+2
-0
vmod_blob.c
vmod/vmod_blob.c
+0
-4
No files found.
bin/varnishd/cache/cache_vrt.c
View file @
0a4884c6
...
...
@@ -1163,6 +1163,9 @@ VRT_blob(VRT_CTX, const char *err, const void *src, size_t len, unsigned type)
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
ws
,
WS_MAGIC
);
if
(
src
==
NULL
||
len
==
0
)
return
(
vrt_null_blob
);
p
=
(
void
*
)
WS_Alloc
(
ctx
->
ws
,
sizeof
*
p
);
if
(
p
==
NULL
)
{
VRT_fail
(
ctx
,
"Workspace overflow (%s)"
,
err
);
...
...
include/vrt.h
View file @
0a4884c6
...
...
@@ -57,6 +57,8 @@
* vrt_null_strands added
* vrt_null_blob added
* VRT_NULL_BLOB_TYPE added as the .type of vrt_null_blob
* VRT_blob() changed to return vrt_null_blob for
* len == 0 or src == NULL arguments
* 13.0 (2021-03-15)
* Move VRT_synth_page() to deprecated status
* Add VRT_synth_strands() and VRT_synth_blob()
...
...
vmod/vmod_blob.c
View file @
0a4884c6
...
...
@@ -539,10 +539,6 @@ vmod_sub(VRT_CTX, VCL_BLOB b, VCL_BYTES n, VCL_BYTES off)
return
(
NULL
);
}
if
(
n
==
0
)
return
(
vrt_null_blob
);
return
(
VRT_blob
(
ctx
,
"blob.sub"
,
(
const
char
*
)
b
->
blob
+
off
,
n
,
b
->
type
));
}
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