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
5536bb31
Commit
5536bb31
authored
Jul 31, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further untangle req/session state engines
parent
feac3715
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
cache_center.c
bin/varnishd/cache/cache_center.c
+17
-18
No files found.
bin/varnishd/cache/cache_center.c
View file @
5536bb31
...
@@ -93,7 +93,7 @@ static unsigned xids;
...
@@ -93,7 +93,7 @@ static unsigned xids;
DOT subgraph xcluster_wait {
DOT subgraph xcluster_wait {
DOT wait [
DOT wait [
DOT shape=box
DOT shape=box
DOT label="cnt_wait:\nwait for\ncomplete\nrequest"
DOT label="cnt_
sess_
wait:\nwait for\ncomplete\nrequest"
DOT ]
DOT ]
DOT herding [shape=hexagon]
DOT herding [shape=hexagon]
DOT wait -> start [label="got req",style=bold,color=green]
DOT wait -> start [label="got req",style=bold,color=green]
...
@@ -104,7 +104,7 @@ DOT }
...
@@ -104,7 +104,7 @@ DOT }
*/
*/
static
int
static
int
cnt_wait
(
struct
sess
*
sp
,
struct
worker
*
wrk
,
struct
req
*
req
)
cnt_
sess_
wait
(
struct
sess
*
sp
,
struct
worker
*
wrk
,
struct
req
*
req
)
{
{
int
j
,
tmo
;
int
j
,
tmo
;
struct
pollfd
pfd
[
1
];
struct
pollfd
pfd
[
1
];
...
@@ -204,7 +204,6 @@ enum cnt_sess_done_ret {
...
@@ -204,7 +204,6 @@ enum cnt_sess_done_ret {
static
enum
cnt_sess_done_ret
static
enum
cnt_sess_done_ret
cnt_sess_done
(
struct
sess
*
sp
,
struct
worker
*
wrk
,
struct
req
*
req
)
cnt_sess_done
(
struct
sess
*
sp
,
struct
worker
*
wrk
,
struct
req
*
req
)
{
{
double
dh
,
dp
,
da
;
int
i
;
int
i
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
...
@@ -228,21 +227,8 @@ cnt_sess_done(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -228,21 +227,8 @@ cnt_sess_done(struct sess *sp, struct worker *wrk, struct req *req)
sp
->
t_idle
=
W_TIM_real
(
wrk
);
sp
->
t_idle
=
W_TIM_real
(
wrk
);
if
(
req
->
xid
==
0
)
{
if
(
req
->
xid
==
0
)
req
->
t_resp
=
sp
->
t_idle
;
req
->
t_resp
=
sp
->
t_idle
;
}
else
{
dp
=
req
->
t_resp
-
req
->
t_req
;
da
=
sp
->
t_idle
-
req
->
t_resp
;
dh
=
req
->
t_req
-
sp
->
t_open
;
/* XXX: Add StatReq == StatSess */
/* XXX: Workaround for pipe */
if
(
sp
->
fd
>=
0
)
{
VSLb
(
req
->
vsl
,
SLT_Length
,
"%ju"
,
(
uintmax_t
)
req
->
req_bodybytes
);
}
VSLb
(
req
->
vsl
,
SLT_ReqEnd
,
"%u %.9f %.9f %.9f %.9f %.9f"
,
req
->
xid
,
req
->
t_req
,
sp
->
t_idle
,
dh
,
dp
,
da
);
}
req
->
xid
=
0
;
req
->
xid
=
0
;
VSL_Flush
(
req
->
vsl
,
0
);
VSL_Flush
(
req
->
vsl
,
0
);
...
@@ -351,7 +337,7 @@ CNT_Session(struct worker *wrk, struct req *req)
...
@@ -351,7 +337,7 @@ CNT_Session(struct worker *wrk, struct req *req)
}
}
if
(
sp
->
sess_step
==
S_STP_NEWREQ
)
{
if
(
sp
->
sess_step
==
S_STP_NEWREQ
)
{
done
=
cnt_wait
(
sp
,
wrk
,
req
);
done
=
cnt_
sess_
wait
(
sp
,
wrk
,
req
);
if
(
done
)
if
(
done
)
return
;
return
;
sp
->
sess_step
=
S_STP_WORKING
;
sp
->
sess_step
=
S_STP_WORKING
;
...
@@ -1593,6 +1579,19 @@ CNT_Request(struct worker *wrk, struct req *req)
...
@@ -1593,6 +1579,19 @@ CNT_Request(struct worker *wrk, struct req *req)
CHECK_OBJ_ORNULL
(
wrk
->
nobjhead
,
OBJHEAD_MAGIC
);
CHECK_OBJ_ORNULL
(
wrk
->
nobjhead
,
OBJHEAD_MAGIC
);
}
}
if
(
done
==
1
)
{
if
(
done
==
1
)
{
/* XXX: Workaround for pipe */
if
(
req
->
sp
->
fd
>=
0
)
{
VSLb
(
req
->
vsl
,
SLT_Length
,
"%ju"
,
(
uintmax_t
)
req
->
req_bodybytes
);
}
VSLb
(
req
->
vsl
,
SLT_ReqEnd
,
"%u %.9f %.9f %.9f %.9f %.9f"
,
req
->
xid
,
req
->
t_req
,
req
->
sp
->
t_idle
,
req
->
sp
->
t_idle
-
req
->
t_resp
,
req
->
t_resp
-
req
->
t_req
,
req
->
sp
->
t_idle
-
req
->
t_resp
);
/* done == 2 was charged by cache_hash.c */
/* done == 2 was charged by cache_hash.c */
SES_Charge
(
wrk
,
req
);
SES_Charge
(
wrk
,
req
);
}
}
...
...
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