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
656cd656
Unverified
Commit
656cd656
authored
Jan 26, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor out root_node_init
parent
33a73ce8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
vdp_pesi.c
src/vdp_pesi.c
+23
-11
No files found.
src/vdp_pesi.c
View file @
656cd656
...
...
@@ -654,7 +654,7 @@ static const struct vdp VDP_pesi_buf = {
*/
static
void
bytes_tree_init
(
struct
bytes_tree
*
bytes_tree
)
bytes_tree_init
(
struct
bytes_tree
*
bytes_tree
,
struct
node
*
root_node
)
{
AN
(
bytes_tree
);
...
...
@@ -664,6 +664,9 @@ bytes_tree_init(struct bytes_tree *bytes_tree)
AZ
(
pthread_cond_init
(
&
bytes_tree
->
cond
,
NULL
));
AZ
(
bytes_tree
->
retval
);
AZ
(
bytes_tree
->
npending
);
bytes_tree
->
front
=
root_node
;
bytes_tree
->
root
=
root_node
;
}
static
void
...
...
@@ -704,6 +707,20 @@ bytes_tree_fini(struct bytes_tree *bytes_tree, struct vdp_ctx *vdc)
tree_free
(
vdc
,
bytes_tree
->
root
);
}
static
void
root_node_init
(
struct
node
*
root_node
,
struct
req
*
req
)
{
CHECK_OBJ_NOTNULL
(
root_node
,
NODE_MAGIC
);
root_node
->
state
=
ST_PRIVATE
;
root_node
->
type
=
T_NEXUS
;
root_node
->
nexus
.
req
=
req
;
root_node
->
nexus
.
gzip
.
magic
=
NEXUS_GZIP_MAGIC
;
root_node
->
nexus
.
npending_private
=
1
;
VSTAILQ_INIT
(
&
root_node
->
nexus
.
children
);
}
/* ------------------------------------------------------------
* process ESI objects from storage
*/
...
...
@@ -762,7 +779,6 @@ vdp_pesi_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
"parallel ESI tree data"
);
return
(
-
1
);
}
bytes_tree_init
(
pesi_tree
->
bytes_tree
);
Lck_New
(
&
pesi_tree
->
task_lock
,
lck_pesi_tree
);
AZ
(
pthread_cond_init
(
&
pesi_tree
->
task_cond
,
NULL
));
...
...
@@ -780,15 +796,11 @@ vdp_pesi_init(VRT_CTX, struct vdp_ctx *vdc, void **priv, struct objcore *oc)
*
priv
=
pesi
;
node_fill_nodestock
(
req
->
ws
,
&
pesi
->
nodestock
);
pesi_tree
->
bytes_tree
->
front
=
pesi_tree
->
bytes_tree
->
root
=
root_node
=
node_alloc
(
pesi
);
CHECK_OBJ_NOTNULL
(
root_node
,
NODE_MAGIC
);
root_node
->
state
=
ST_PRIVATE
;
root_node
->
type
=
T_NEXUS
;
root_node
->
nexus
.
req
=
req
;
root_node
->
nexus
.
gzip
.
magic
=
NEXUS_GZIP_MAGIC
;
root_node
->
nexus
.
npending_private
=
1
;
VSTAILQ_INIT
(
&
root_node
->
nexus
.
children
);
root_node
=
node_alloc
(
pesi
);
root_node_init
(
root_node
,
req
);
bytes_tree_init
(
pesi_tree
->
bytes_tree
,
root_node
);
pesi
->
node
=
root_node
;
AZ
(
pecx
->
state
);
...
...
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