Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvdp-pesi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
uplex-varnish
libvdp-pesi
Commits
974857ec
Commit
974857ec
authored
Aug 02, 2019
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid the magic pointer for gzip headers, use T_CRC
parent
fb0d4d2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
+23
-23
node.c
src/node.c
+10
-0
node.h
src/node.h
+1
-0
vdp_pesi.c
src/vdp_pesi.c
+12
-23
No files found.
src/node.c
View file @
974857ec
...
@@ -558,6 +558,13 @@ push_subreq(struct req *req, struct bytes_tree *tree,
...
@@ -558,6 +558,13 @@ push_subreq(struct req *req, struct bytes_tree *tree,
return
(
tree
->
retval
);
return
(
tree
->
retval
);
}
}
static
const
uint8_t
gzip_hdr
[]
=
{
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x03
};
static
void
static
void
gzip_tailbuf
(
uint8_t
tailbuf
[
GZIP_TAILBUF_SZ
],
struct
nexus_gzip
*
gz
)
gzip_tailbuf
(
uint8_t
tailbuf
[
GZIP_TAILBUF_SZ
],
struct
nexus_gzip
*
gz
)
{
{
...
@@ -596,6 +603,9 @@ push_crc(struct req *req, struct bytes_tree *tree,
...
@@ -596,6 +603,9 @@ push_crc(struct req *req, struct bytes_tree *tree,
AN
(
nex
->
nexus
.
gzip
.
is
);
AN
(
nex
->
nexus
.
gzip
.
is
);
switch
(
node
->
crc
.
ctype
)
{
switch
(
node
->
crc
.
ctype
)
{
case
GZIP_HDR
:
return
(
VDP_bytes
(
nex
->
nexus
.
req
,
VDP_NULL
,
gzip_hdr
,
sizeof
gzip_hdr
));
case
UPDATE
:
case
UPDATE
:
nex
->
nexus
.
gzip
.
crc
=
crc32_combine
(
nex
->
nexus
.
gzip
.
crc
=
crc32_combine
(
nex
->
nexus
.
gzip
.
crc
,
node
->
crc
.
icrc
,
nex
->
nexus
.
gzip
.
crc
,
node
->
crc
.
icrc
,
...
...
src/node.h
View file @
974857ec
...
@@ -119,6 +119,7 @@ struct node_nexus {
...
@@ -119,6 +119,7 @@ struct node_nexus {
enum
t_crc
{
enum
t_crc
{
INVALID
=
0
,
INVALID
=
0
,
GZIP_HDR
,
UPDATE
,
UPDATE
,
FINAL
// combine with parent or gen tail
FINAL
// combine with parent or gen tail
};
};
...
...
src/vdp_pesi.c
View file @
974857ec
...
@@ -76,13 +76,6 @@ int block_final = 0;
...
@@ -76,13 +76,6 @@ int block_final = 0;
*/
*/
int
front_push
=
0
;
int
front_push
=
0
;
static
const
uint8_t
gzip_hdr
[]
=
{
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x03
};
/* Forward declarations */
/* Forward declarations */
const
struct
vdp
VDP_pesi_buf
;
const
struct
vdp
VDP_pesi_buf
;
static
const
struct
transport
VPED_transport
;
static
const
struct
transport
VPED_transport
;
...
@@ -536,9 +529,7 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv,
...
@@ -536,9 +529,7 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv,
/*
/*
* non-api knowledge from VDP_DeliverObj()
* non-api knowledge from VDP_DeliverObj()
* final = req->objcore->flags & (OC_F_PRIVATE | OC_F_HFM | OC_F_HFP);
* final = req->objcore->flags & (OC_F_PRIVATE | OC_F_HFM | OC_F_HFP);
*/
*
/*
* if data is coming from a varnish-cache simple storage, we know that
* if data is coming from a varnish-cache simple storage, we know that
* - for non-final objects
* - for non-final objects
* - as long as we keep a reference
* - as long as we keep a reference
...
@@ -556,11 +547,7 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv,
...
@@ -556,11 +547,7 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv,
HSH_Ref
(
parent
->
nexus
.
oc
);
HSH_Ref
(
parent
->
nexus
.
oc
);
}
}
// XXX make gzip_hdr a T_CRC ?
refok
=
(
parent
->
nexus
.
oc
!=
NULL
);
refok
=
((
parent
->
nexus
.
oc
!=
NULL
)
||
// from vdp_pesi_bytes
(
ptr
==
gzip_hdr
));
AN
(
ptr
);
AN
(
ptr
);
AZ
(
node
->
data
.
ptr
);
AZ
(
node
->
data
.
ptr
);
...
@@ -903,14 +890,16 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv,
...
@@ -903,14 +890,16 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv,
pecx
->
e
=
pecx
->
p
+
l
;
pecx
->
e
=
pecx
->
p
+
l
;
if
(
*
pecx
->
p
==
VEC_GZ
)
{
if
(
*
pecx
->
p
==
VEC_GZ
)
{
/*
if
(
parent_gzip
==
NULL
)
{
* this will, in pesi_buf_bytes(), create a
AZ
(
child
);
* T_DATA node which ref's gzip_hdr. Should we
child
=
node_alloc
();
* rather add a T_GZIPHDR node?
CHECK_OBJ_NOTNULL
(
child
,
NODE_MAGIC
);
*/
child
->
type
=
T_CRC
;
if
(
parent_gzip
==
NULL
)
child
->
state
=
ST_DATA
;
retval
=
VDP_bytes
(
req
,
VDP_NULL
,
child
->
crc
.
ctype
=
GZIP_HDR
;
gzip_hdr
,
10
);
node_insert
(
tree
,
node
,
child
);
child
=
NULL
;
}
node
->
nexus
.
gzip
.
is
=
1
;
node
->
nexus
.
gzip
.
is
=
1
;
node
->
nexus
.
gzip
.
crc
=
crc32
(
0L
,
Z_NULL
,
0
);
node
->
nexus
.
gzip
.
crc
=
crc32
(
0L
,
Z_NULL
,
0
);
AZ
(
node
->
nexus
.
gzip
.
l_crc
);
AZ
(
node
->
nexus
.
gzip
.
l_crc
);
...
...
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