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
18c88fbd
Commit
18c88fbd
authored
Oct 22, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make statistics a caller task and simply V1L_FlushRelease()
parent
bc31f5c1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
39 deletions
+18
-39
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+1
-1
cache_http1_deliver.c
bin/varnishd/http1/cache_http1_deliver.c
+1
-1
cache_http1_fetch.c
bin/varnishd/http1/cache_http1_fetch.c
+7
-12
cache_http1_line.c
bin/varnishd/http1/cache_http1_line.c
+5
-16
cache_http1_pipe.c
bin/varnishd/http1/cache_http1_pipe.c
+3
-8
No files found.
bin/varnishd/cache/cache.h
View file @
18c88fbd
...
...
@@ -953,7 +953,7 @@ void V1L_Chunked(const struct worker *w);
void
V1L_EndChunk
(
const
struct
worker
*
w
);
void
V1L_Reserve
(
struct
worker
*
w
,
int
*
fd
,
struct
vsl_log
*
,
double
t0
);
unsigned
V1L_Flush
(
const
struct
worker
*
w
);
unsigned
V1L_FlushRelease
(
struct
worker
*
w
,
uint64_t
*
pacc
);
unsigned
V1L_FlushRelease
(
struct
worker
*
w
);
unsigned
V1L_Write
(
const
struct
worker
*
w
,
const
void
*
ptr
,
int
len
);
/* cache_session.c [SES] */
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
18c88fbd
...
...
@@ -56,7 +56,7 @@ ved_include(struct req *preq, const char *src, const char *host)
if
(
preq
->
esi_level
>=
cache_param
->
max_esi_depth
)
return
;
(
void
)
V1L_FlushRelease
(
preq
->
wrk
,
NULL
);
(
void
)
V1L_FlushRelease
(
preq
->
wrk
);
/* Take a workspace snapshot */
wrk_ws_wm
=
WS_Snapshot
(
wrk
->
aws
);
/* XXX ? */
...
...
bin/varnishd/http1/cache_http1_deliver.c
View file @
18c88fbd
...
...
@@ -381,7 +381,7 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
!
(
req
->
res_mode
&
RES_ESI_CHILD
))
V1L_EndChunk
(
req
->
wrk
);
if
((
V1L_FlushRelease
(
req
->
wrk
,
NULL
)
||
ois
!=
OIS_DONE
)
&&
if
((
V1L_FlushRelease
(
req
->
wrk
)
||
ois
!=
OIS_DONE
)
&&
req
->
sp
->
fd
>=
0
)
SES_Close
(
req
->
sp
,
SC_REM_CLOSE
);
}
bin/varnishd/http1/cache_http1_fetch.c
View file @
18c88fbd
...
...
@@ -50,14 +50,14 @@
static
int
__match_proto__
(
req_body_iter_f
)
vbf_iter_req_body
(
struct
req
*
req
,
void
*
priv
,
void
*
ptr
,
size_t
l
)
{
struct
worker
*
wrk
;
struct
busyobj
*
bo
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CAST_OBJ_NOTNULL
(
wrk
,
priv
,
WORKER
_MAGIC
);
CAST_OBJ_NOTNULL
(
bo
,
priv
,
BUSYOBJ
_MAGIC
);
if
(
l
>
0
)
{
(
void
)
V1L_Write
(
wrk
,
ptr
,
l
);
if
(
V1L_Flush
(
wrk
))
bo
->
acct
.
bereq_bodybytes
+=
V1L_Write
(
bo
->
wrk
,
ptr
,
l
);
if
(
V1L_Flush
(
bo
->
wrk
))
return
(
-
1
);
}
return
(
0
);
...
...
@@ -82,7 +82,6 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo)
int
retry
=
-
1
;
int
i
,
j
,
first
;
struct
http_conn
*
htc
;
ssize_t
hdrbytes
;
int
do_chunked
=
0
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
...
...
@@ -113,7 +112,7 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo)
(
void
)
VTCP_blocking
(
vc
->
fd
);
/* XXX: we should timeout instead */
V1L_Reserve
(
wrk
,
&
vc
->
fd
,
bo
->
vsl
,
bo
->
t_prev
);
hdrbytes
=
HTTP1_Write
(
wrk
,
hp
,
HTTP1_Req
);
bo
->
acct
.
bereq_
hdrbytes
=
HTTP1_Write
(
wrk
,
hp
,
HTTP1_Req
);
/* Deal with any message-body the request might (still) have */
i
=
0
;
...
...
@@ -121,7 +120,7 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo)
if
(
bo
->
req
!=
NULL
)
{
if
(
do_chunked
)
V1L_Chunked
(
wrk
);
i
=
VRB_Iterate
(
bo
->
req
,
vbf_iter_req_body
,
wrk
);
i
=
VRB_Iterate
(
bo
->
req
,
vbf_iter_req_body
,
bo
);
if
(
bo
->
req
->
req_body_status
==
REQ_BODY_TAKEN
)
{
retry
=
-
1
;
...
...
@@ -136,11 +135,7 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo)
V1L_EndChunk
(
wrk
);
}
j
=
V1L_FlushRelease
(
wrk
,
&
bo
->
acct
.
bereq_hdrbytes
);
if
(
bo
->
acct
.
bereq_hdrbytes
>
hdrbytes
)
{
bo
->
acct
.
bereq_bodybytes
=
bo
->
acct
.
bereq_hdrbytes
-
hdrbytes
;
bo
->
acct
.
bereq_hdrbytes
=
hdrbytes
;
}
j
=
V1L_FlushRelease
(
wrk
);
if
(
j
!=
0
||
i
!=
0
)
{
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"backend write error: %d (%s)"
,
errno
,
strerror
(
errno
));
...
...
bin/varnishd/http1/cache_http1_line.c
View file @
18c88fbd
...
...
@@ -93,19 +93,20 @@ V1L_Reserve(struct worker *wrk, int *fd, struct vsl_log *vsl, double t0)
wrk
->
v1l
=
v1l
;
}
static
void
v1l_release
(
struct
worker
*
wrk
,
uint64_t
*
pacc
)
unsigned
V1L_FlushRelease
(
struct
worker
*
wrk
)
{
struct
v1l
*
v1l
;
unsigned
u
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
u
=
V1L_Flush
(
wrk
);
v1l
=
wrk
->
v1l
;
wrk
->
v1l
=
NULL
;
CHECK_OBJ_NOTNULL
(
v1l
,
V1L_MAGIC
);
if
(
pacc
!=
NULL
)
*
pacc
+=
v1l
->
cnt
;
WS_Release
(
wrk
->
aws
,
0
);
WS_Reset
(
wrk
->
aws
,
NULL
);
return
(
u
);
}
static
void
...
...
@@ -210,18 +211,6 @@ V1L_Flush(const struct worker *wrk)
return
(
v1l
->
werr
);
}
unsigned
V1L_FlushRelease
(
struct
worker
*
wrk
,
uint64_t
*
pacc
)
{
unsigned
u
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
AN
(
wrk
->
v1l
->
wfd
);
u
=
V1L_Flush
(
wrk
);
v1l_release
(
wrk
,
pacc
);
return
(
u
);
}
unsigned
V1L_Write
(
const
struct
worker
*
wrk
,
const
void
*
ptr
,
int
len
)
{
...
...
bin/varnishd/http1/cache_http1_pipe.c
View file @
18c88fbd
...
...
@@ -99,7 +99,6 @@ V1P_Process(struct req *req, struct busyobj *bo)
struct
pollfd
fds
[
2
];
int
i
,
fd
;
struct
acct_pipe
acct_pipe
;
ssize_t
hdrbytes
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
sp
,
SESS_MAGIC
);
...
...
@@ -125,17 +124,13 @@ V1P_Process(struct req *req, struct busyobj *bo)
(
void
)
VTCP_blocking
(
fd
);
V1L_Reserve
(
wrk
,
&
fd
,
bo
->
vsl
,
req
->
t_req
);
hdrbytes
=
HTTP1_Write
(
wrk
,
bo
->
bereq
,
HTTP1_Req
);
acct_pipe
.
bereq
+
=
HTTP1_Write
(
wrk
,
bo
->
bereq
,
HTTP1_Req
);
if
(
req
->
htc
->
pipeline_b
!=
NULL
)
(
void
)
V1L_Write
(
wrk
,
req
->
htc
->
pipeline_b
,
acct_pipe
.
in
+=
V1L_Write
(
wrk
,
req
->
htc
->
pipeline_b
,
req
->
htc
->
pipeline_e
-
req
->
htc
->
pipeline_b
);
i
=
V1L_FlushRelease
(
wrk
,
&
acct_pipe
.
bereq
);
if
(
acct_pipe
.
bereq
>
hdrbytes
)
{
acct_pipe
.
in
=
acct_pipe
.
bereq
-
hdrbytes
;
acct_pipe
.
bereq
=
hdrbytes
;
}
i
=
V1L_FlushRelease
(
wrk
);
VSLb_ts_req
(
req
,
"Pipe"
,
W_TIM_real
(
wrk
));
...
...
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