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
48b9d1bf
Unverified
Commit
48b9d1bf
authored
Jun 02, 2021
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Promote the null blob to vrt
parent
05e10eee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+5
-0
vrt.h
include/vrt.h
+5
-0
vmod_blob.c
vmod/vmod_blob.c
+3
-10
No files found.
bin/varnishd/cache/cache_vrt.c
View file @
48b9d1bf
...
@@ -60,6 +60,11 @@ const struct strands *vrt_null_strands = &(struct strands){
...
@@ -60,6 +60,11 @@ const struct strands *vrt_null_strands = &(struct strands){
.
n
=
0
,
.
n
=
0
,
.
p
=
(
const
char
*
[
1
]){
NULL
}
.
p
=
(
const
char
*
[
1
]){
NULL
}
};
};
const
struct
vrt_blob
*
vrt_null_blob
=
&
(
struct
vrt_blob
){
.
type
=
VRT_NULL_BLOB_TYPE
,
.
len
=
0
,
.
blob
=
"
\0
"
};
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
...
...
include/vrt.h
View file @
48b9d1bf
...
@@ -55,6 +55,8 @@
...
@@ -55,6 +55,8 @@
*
*
* NEXT (2021-09-15)
* NEXT (2021-09-15)
* vrt_null_strands added
* vrt_null_strands added
* vrt_null_blob added
* VRT_NULL_BLOB_TYPE added as the .type of vrt_null_blob
* 13.0 (2021-03-15)
* 13.0 (2021-03-15)
* Move VRT_synth_page() to deprecated status
* Move VRT_synth_page() to deprecated status
* Add VRT_synth_strands() and VRT_synth_blob()
* Add VRT_synth_strands() and VRT_synth_blob()
...
@@ -271,6 +273,9 @@ struct vrt_blob {
...
@@ -271,6 +273,9 @@ struct vrt_blob {
const
void
*
blob
;
const
void
*
blob
;
};
};
#define VRT_NULL_BLOB_TYPE 0xfade4fa0
extern
const
struct
vrt_blob
*
vrt_null_blob
;
/***********************************************************************
/***********************************************************************
* This is the central definition of the mapping from VCL types to
* This is the central definition of the mapping from VCL types to
* C-types. The python scripts read these from here.
* C-types. The python scripts read these from here.
...
...
vmod/vmod_blob.c
View file @
48b9d1bf
...
@@ -114,13 +114,6 @@ static const struct vmod_blob_fptr {
...
@@ -114,13 +114,6 @@ static const struct vmod_blob_fptr {
static
char
empty
[
1
]
=
{
'\0'
};
static
char
empty
[
1
]
=
{
'\0'
};
static
const
struct
vrt_blob
null_blob
[
1
]
=
{{
#define VMOD_BLOB_NULL_TYPE 0xfade4fa0
.
type
=
VMOD_BLOB_NULL_TYPE
,
.
len
=
0
,
.
blob
=
empty
,
}};
static
enum
encoding
static
enum
encoding
parse_encoding
(
VCL_ENUM
e
)
parse_encoding
(
VCL_ENUM
e
)
{
{
...
@@ -235,7 +228,7 @@ vmod_blob__init(VRT_CTX, struct vmod_blob_blob **blobp, const char *vcl_name,
...
@@ -235,7 +228,7 @@ vmod_blob__init(VRT_CTX, struct vmod_blob_blob **blobp, const char *vcl_name,
}
}
if
(
len
==
0
)
{
if
(
len
==
0
)
{
free
(
buf
);
free
(
buf
);
memcpy
(
&
b
->
blob
,
null_blob
,
sizeof
b
->
blob
);
memcpy
(
&
b
->
blob
,
vrt_
null_blob
,
sizeof
b
->
blob
);
return
;
return
;
}
}
b
->
blob
.
len
=
len
;
b
->
blob
.
len
=
len
;
...
@@ -359,7 +352,7 @@ vmod_decode(VRT_CTX, VCL_ENUM decs, VCL_INT length, VCL_STRANDS strings)
...
@@ -359,7 +352,7 @@ vmod_decode(VRT_CTX, VCL_ENUM decs, VCL_INT length, VCL_STRANDS strings)
}
}
if
(
len
==
0
)
{
if
(
len
==
0
)
{
WS_Release
(
ctx
->
ws
,
0
);
WS_Release
(
ctx
->
ws
,
0
);
return
(
null_blob
);
return
(
vrt_
null_blob
);
}
}
WS_Release
(
ctx
->
ws
,
len
);
WS_Release
(
ctx
->
ws
,
len
);
...
@@ -547,7 +540,7 @@ vmod_sub(VRT_CTX, VCL_BLOB b, VCL_BYTES n, VCL_BYTES off)
...
@@ -547,7 +540,7 @@ vmod_sub(VRT_CTX, VCL_BLOB b, VCL_BYTES n, VCL_BYTES off)
}
}
if
(
n
==
0
)
if
(
n
==
0
)
return
(
null_blob
);
return
(
vrt_
null_blob
);
return
(
VRT_blob
(
ctx
,
"blob.sub"
,
return
(
VRT_blob
(
ctx
,
"blob.sub"
,
...
...
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