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
f7f0af00
Commit
f7f0af00
authored
Jul 31, 2019
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move pecx members where they belong
parent
fc5d0d65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
18 deletions
+21
-18
vdp_pesi.c
src/vdp_pesi.c
+21
-18
No files found.
src/vdp_pesi.c
View file @
f7f0af00
...
@@ -276,6 +276,9 @@ struct pesi_tree {
...
@@ -276,6 +276,9 @@ struct pesi_tree {
/*
/*
* per request state
* per request state
*
*
* pecx: ESI parser
* pesi: any request
*
*/
*/
struct
pecx
{
struct
pecx
{
unsigned
magic
;
unsigned
magic
;
...
@@ -283,12 +286,8 @@ struct pecx {
...
@@ -283,12 +286,8 @@ struct pecx {
const
uint8_t
*
p
;
const
uint8_t
*
p
;
const
uint8_t
*
e
;
const
uint8_t
*
e
;
struct
worker
*
wrk
;
struct
node
*
node
;
ssize_t
l
;
ssize_t
l
;
int
state
;
int
state
;
int
woken
;
};
};
struct
pesi
{
struct
pesi
{
...
@@ -297,6 +296,10 @@ struct pesi {
...
@@ -297,6 +296,10 @@ struct pesi {
unsigned
has_task
:
1
;
unsigned
has_task
:
1
;
struct
pesi_tree
*
pesi_tree
;
struct
pesi_tree
*
pesi_tree
;
struct
worker
*
wrk
;
struct
node
*
node
;
int
woken
;
struct
pecx
pecx
[
1
];
struct
pecx
pecx
[
1
];
VTAILQ_ENTRY
(
pesi
)
list
;
VTAILQ_ENTRY
(
pesi
)
list
;
};
};
...
@@ -936,8 +939,8 @@ ved_task(struct worker *wrk, void *priv)
...
@@ -936,8 +939,8 @@ ved_task(struct worker *wrk, void *priv)
CHECK_OBJ_NOTNULL
(
pesi_tree
,
PESI_TREE_MAGIC
);
CHECK_OBJ_NOTNULL
(
pesi_tree
,
PESI_TREE_MAGIC
);
pecx
=
pesi
->
pecx
;
pecx
=
pesi
->
pecx
;
CHECK_OBJ_NOTNULL
(
pecx
,
PECX_MAGIC
);
CHECK_OBJ_NOTNULL
(
pecx
,
PECX_MAGIC
);
pe
cx
->
wrk
=
wrk
;
pe
si
->
wrk
=
wrk
;
node
=
pe
cx
->
node
;
node
=
pe
si
->
node
;
CHECK_OBJ_NOTNULL
(
node
,
NODE_MAGIC
);
CHECK_OBJ_NOTNULL
(
node
,
NODE_MAGIC
);
CHECK_OBJ_NOTNULL
(
pesi_tree
->
tree
,
BYTES_TREE_MAGIC
);
CHECK_OBJ_NOTNULL
(
pesi_tree
->
tree
,
BYTES_TREE_MAGIC
);
...
@@ -962,7 +965,7 @@ ved_task(struct worker *wrk, void *priv)
...
@@ -962,7 +965,7 @@ ved_task(struct worker *wrk, void *priv)
while
(
1
)
{
while
(
1
)
{
req
->
wrk
=
wrk
;
req
->
wrk
=
wrk
;
pe
cx
->
woken
=
0
;
pe
si
->
woken
=
0
;
VSLdbgv
(
req
,
"Starting CNT_Request() req=%p"
,
req
);
VSLdbgv
(
req
,
"Starting CNT_Request() req=%p"
,
req
);
s
=
CNT_Request
(
req
);
s
=
CNT_Request
(
req
);
VSLdbgv
(
req
,
"CNT_Request()=%d req=%p"
,
s
,
req
);
VSLdbgv
(
req
,
"CNT_Request()=%d req=%p"
,
s
,
req
);
...
@@ -972,14 +975,14 @@ ved_task(struct worker *wrk, void *priv)
...
@@ -972,14 +975,14 @@ ved_task(struct worker *wrk, void *priv)
"loop waiting for ESI (%d)"
,
(
int
)
s
);
"loop waiting for ESI (%d)"
,
(
int
)
s
);
assert
(
s
==
REQ_FSM_DISEMBARK
);
assert
(
s
==
REQ_FSM_DISEMBARK
);
Lck_Lock
(
&
req
->
sp
->
mtx
);
Lck_Lock
(
&
req
->
sp
->
mtx
);
if
(
!
pe
cx
->
woken
)
{
if
(
!
pe
si
->
woken
)
{
VSLb
(
req
->
vsl
,
SLT_Debug
,
"Waiting for busyobj"
);
VSLb
(
req
->
vsl
,
SLT_Debug
,
"Waiting for busyobj"
);
(
void
)
Lck_CondWait
(
(
void
)
Lck_CondWait
(
&
wrk
->
cond
,
&
req
->
sp
->
mtx
,
0
);
&
wrk
->
cond
,
&
req
->
sp
->
mtx
,
0
);
VSLb
(
req
->
vsl
,
SLT_Debug
,
"busyobj wakeup"
);
VSLb
(
req
->
vsl
,
SLT_Debug
,
"busyobj wakeup"
);
}
}
Lck_Unlock
(
&
req
->
sp
->
mtx
);
Lck_Unlock
(
&
req
->
sp
->
mtx
);
pe
cx
->
woken
=
0
;
pe
si
->
woken
=
0
;
AZ
(
req
->
wrk
);
AZ
(
req
->
wrk
);
VSLdbg
(
req
,
"Calling CNT_Embark()"
);
VSLdbg
(
req
,
"Calling CNT_Embark()"
);
CNT_Embark
(
wrk
,
req
);
CNT_Embark
(
wrk
,
req
);
...
@@ -1221,7 +1224,7 @@ vped_include(struct req *preq, const char *src, const char *host,
...
@@ -1221,7 +1224,7 @@ vped_include(struct req *preq, const char *src, const char *host,
npecx
=
pesi2
->
pecx
;
npecx
=
pesi2
->
pecx
;
AZ
(
npecx
->
state
);
AZ
(
npecx
->
state
);
npecx
->
node
=
node
;
pesi2
->
node
=
node
;
req
->
transport_priv
=
pesi2
;
req
->
transport_priv
=
pesi2
;
...
@@ -1903,7 +1906,7 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv,
...
@@ -1903,7 +1906,7 @@ pesi_buf_bytes(struct req *req, enum vdp_action act, void **priv,
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
pesi
->
pecx
,
PECX_MAGIC
);
CHECK_OBJ_NOTNULL
(
pesi
->
pecx
,
PECX_MAGIC
);
parent
=
pesi
->
pecx
->
node
;
parent
=
pesi
->
node
;
CHECK_OBJ_NOTNULL
(
parent
,
NODE_MAGIC
);
CHECK_OBJ_NOTNULL
(
parent
,
NODE_MAGIC
);
assert
(
parent
->
type
==
T_NEXUS
);
assert
(
parent
->
type
==
T_NEXUS
);
VSLdbgv
(
req
,
"bytes_add: parent=%p front=%p"
,
VSLdbgv
(
req
,
"bytes_add: parent=%p front=%p"
,
...
@@ -2171,9 +2174,9 @@ vdp_pesi_init(struct req *req, void **priv)
...
@@ -2171,9 +2174,9 @@ vdp_pesi_init(struct req *req, void **priv)
AZ
(
pthread_cond_init
(
&
pesi_tree
->
tree
->
cond
,
NULL
));
AZ
(
pthread_cond_init
(
&
pesi_tree
->
tree
->
cond
,
NULL
));
AZ
(
pesi_tree
->
tree
->
retval
);
AZ
(
pesi_tree
->
tree
->
retval
);
pe
cx
->
node
=
pesi_tree
->
tree
->
root
;
pe
si
->
node
=
pesi_tree
->
tree
->
root
;
AZ
(
pecx
->
state
);
AZ
(
pecx
->
state
);
AZ
(
pe
cx
->
woken
);
AZ
(
pe
si
->
woken
);
VDP_Push
(
req
,
&
VDP_pesi_buf
,
pesi
);
VDP_Push
(
req
,
&
VDP_pesi_buf
,
pesi
);
return
(
0
);
return
(
0
);
...
@@ -2203,7 +2206,7 @@ vdp_pesi_fini(struct req *req, void **priv)
...
@@ -2203,7 +2206,7 @@ vdp_pesi_fini(struct req *req, void **priv)
// XXX turn assertion - can we close in vdp_pesi_bytes?
// XXX turn assertion - can we close in vdp_pesi_bytes?
pecx
=
pesi
->
pecx
;
pecx
=
pesi
->
pecx
;
CHECK_OBJ_NOTNULL
(
pecx
,
PECX_MAGIC
);
CHECK_OBJ_NOTNULL
(
pecx
,
PECX_MAGIC
);
node
=
pe
cx
->
node
;
node
=
pe
si
->
node
;
CHECK_OBJ_NOTNULL
(
node
,
NODE_MAGIC
);
CHECK_OBJ_NOTNULL
(
node
,
NODE_MAGIC
);
if
(
req
->
esi_level
>
0
)
{
if
(
req
->
esi_level
>
0
)
{
...
@@ -2296,7 +2299,7 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv,
...
@@ -2296,7 +2299,7 @@ vdp_pesi_bytes(struct req *req, enum vdp_action act, void **priv,
pecx
=
pesi
->
pecx
;
pecx
=
pesi
->
pecx
;
tree
=
pesi
->
pesi_tree
->
tree
;
tree
=
pesi
->
pesi_tree
->
tree
;
node
=
pe
cx
->
node
;
node
=
pe
si
->
node
;
CHECK_OBJ_NOTNULL
(
node
,
NODE_MAGIC
);
CHECK_OBJ_NOTNULL
(
node
,
NODE_MAGIC
);
/*
/*
...
@@ -2548,8 +2551,8 @@ vped_reembark(struct worker *wrk, struct req *req)
...
@@ -2548,8 +2551,8 @@ vped_reembark(struct worker *wrk, struct req *req)
VSLb
(
req
->
vsl
,
SLT_Debug
,
"reembark wakeup"
);
VSLb
(
req
->
vsl
,
SLT_Debug
,
"reembark wakeup"
);
Lck_Lock
(
&
req
->
sp
->
mtx
);
Lck_Lock
(
&
req
->
sp
->
mtx
);
pesi
->
pecx
->
woken
=
1
;
pesi
->
woken
=
1
;
AZ
(
pthread_cond_signal
(
&
pesi
->
pecx
->
wrk
->
cond
));
AZ
(
pthread_cond_signal
(
&
pesi
->
wrk
->
cond
));
Lck_Unlock
(
&
req
->
sp
->
mtx
);
Lck_Unlock
(
&
req
->
sp
->
mtx
);
}
}
...
@@ -2624,7 +2627,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
...
@@ -2624,7 +2627,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
CHECK_OBJ_NOTNULL
(
pesi
->
pesi_tree
->
tree
,
BYTES_TREE_MAGIC
);
CHECK_OBJ_NOTNULL
(
pesi
->
pesi_tree
->
tree
,
BYTES_TREE_MAGIC
);
tree
=
pesi
->
pesi_tree
->
tree
;
tree
=
pesi
->
pesi_tree
->
tree
;
node
=
pesi
->
pecx
->
node
;
node
=
pesi
->
node
;
parent
=
node
->
parent
;
parent
=
node
->
parent
;
CHECK_OBJ_NOTNULL
(
parent
,
NODE_MAGIC
);
CHECK_OBJ_NOTNULL
(
parent
,
NODE_MAGIC
);
assert
(
parent
->
type
==
T_NEXUS
);
assert
(
parent
->
type
==
T_NEXUS
);
...
...
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