Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-zipflow
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-zipflow
Commits
9a8bc6d7
Unverified
Commit
9a8bc6d7
authored
Jul 25, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a zipflow top data structure
parent
91b28e41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
2 deletions
+35
-2
vmod_zipflow.c
src/vmod_zipflow.c
+35
-2
No files found.
src/vmod_zipflow.c
View file @
9a8bc6d7
...
...
@@ -60,6 +60,7 @@ assert_zlib(void)
static
char
default_level
=
Z_DEFAULT_COMPRESSION
;
static
const
void
*
zipflow_request_priv
=
&
zipflow_request_priv
;
static
const
void
*
zipflow_top_priv
=
&
zipflow_top_priv
;
struct
zipflow_top
;
struct
zipflow_request
{
...
...
@@ -71,10 +72,10 @@ struct zipflow_request {
unsigned
mode
;
uint32_t
atime
,
mtime
;
ZIP
*
zip
;
VS
LIST
_ENTRY
(
zipflow_request
)
list
;
VS
TAILQ
_ENTRY
(
zipflow_request
)
list
;
};
VS
LIST
_HEAD
(
zipflow_head
,
zipflow_request
);
VS
TAILQ
_HEAD
(
zipflow_head
,
zipflow_request
);
struct
zipflow_top
{
unsigned
magic
;
...
...
@@ -82,6 +83,31 @@ struct zipflow_top {
struct
zipflow_head
head
;
};
static
struct
zipflow_top
*
get_zipflow_top
(
VRT_CTX
)
{
struct
vmod_priv
*
task_priv
;
struct
zipflow_top
*
zft
;
task_priv
=
VRT_priv_task
(
ctx
,
zipflow_top_priv
);
if
(
task_priv
==
NULL
)
{
VRT_fail
(
ctx
,
"Can not get PRIV_TASK"
);
return
(
NULL
);
}
if
(
task_priv
->
priv
!=
NULL
)
{
CAST_OBJ_NOTNULL
(
zft
,
task_priv
->
priv
,
ZIPFLOW_TOP_MAGIC
);
return
(
zft
);
}
WS_TASK_ALLOC_OBJ
(
ctx
,
zft
,
ZIPFLOW_TOP_MAGIC
);
if
(
zft
==
NULL
)
return
(
NULL
);
VSTAILQ_INIT
(
&
zft
->
head
);
return
(
zft
);
}
static
struct
vdp
vdp_zipflow
;
static
struct
zipflow_request
*
...
...
@@ -89,6 +115,7 @@ get_zipflow_request(VRT_CTX)
{
struct
vmod_priv
*
task_priv
;
struct
zipflow_request
*
zfr
;
struct
zipflow_top
*
zft
;
task_priv
=
VRT_priv_task
(
ctx
,
zipflow_request_priv
);
if
(
task_priv
==
NULL
)
{
...
...
@@ -101,10 +128,16 @@ get_zipflow_request(VRT_CTX)
return
(
zfr
);
}
zft
=
get_zipflow_top
(
ctx
);
if
(
zft
==
NULL
)
return
(
NULL
);
WS_TASK_ALLOC_OBJ
(
ctx
,
zfr
,
ZIPFLOW_REQUEST_MAGIC
);
if
(
zfr
==
NULL
)
return
(
NULL
);
VSTAILQ_INSERT_TAIL
(
&
zft
->
head
,
zfr
,
list
);
zfr
->
bundle
=
1
;
zfr
->
level
=
default_level
;
zfr
->
name
=
"unnamed_file"
;
...
...
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