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
6e68c081
Commit
6e68c081
authored
Mar 24, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further flesh out the WRW chunked support
parent
306f74bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
cache.h
bin/varnishd/cache.h
+1
-0
cache_center.c
bin/varnishd/cache_center.c
+2
-0
cache_wrw.c
bin/varnishd/cache_wrw.c
+23
-4
No files found.
bin/varnishd/cache.h
View file @
6e68c081
...
...
@@ -790,6 +790,7 @@ void WRK_SumStat(struct worker *w);
#define WRW_IsReleased(w) ((w)->wrw.wfd == NULL)
void
WRW_Chunked
(
struct
worker
*
w
);
void
WRW_EndChunk
(
struct
worker
*
w
);
void
WRW_Reserve
(
struct
worker
*
w
,
int
*
fd
);
unsigned
WRW_Flush
(
struct
worker
*
w
);
unsigned
WRW_FlushRelease
(
struct
worker
*
w
);
...
...
bin/varnishd/cache_center.c
View file @
6e68c081
...
...
@@ -241,6 +241,7 @@ cnt_deliver(struct sess *sp)
RES_WriteObj
(
sp
);
assert
(
WRW_IsReleased
(
sp
->
wrk
));
assert
(
sp
->
wrk
->
wrw
.
ciov
==
sp
->
wrk
->
wrw
.
siov
);
(
void
)
HSH_Deref
(
sp
->
wrk
,
NULL
,
&
sp
->
obj
);
http_Setup
(
sp
->
wrk
->
resp
,
NULL
);
sp
->
step
=
STP_DONE
;
...
...
@@ -1153,6 +1154,7 @@ cnt_recv(struct sess *sp)
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
->
vcl
,
VCL_CONF_MAGIC
);
AZ
(
sp
->
obj
);
assert
(
sp
->
wrk
->
wrw
.
ciov
==
sp
->
wrk
->
wrw
.
siov
);
/* By default we use the first backend */
AZ
(
sp
->
director
);
...
...
bin/varnishd/cache_wrw.c
View file @
6e68c081
...
...
@@ -115,9 +115,9 @@ WRW_Flush(struct worker *w)
if
(
wrw
->
ciov
<
wrw
->
siov
)
assert
(
wrw
->
niov
<
wrw
->
siov
);
if
(
*
wrw
->
wfd
>=
0
&&
wrw
->
n
iov
>
0
&&
wrw
->
werr
==
0
)
{
if
(
wrw
->
ciov
<
wrw
->
siov
&&
wrw
->
liov
>
0
)
{
bprintf
(
cbuf
,
"%jx
\r\n
"
,
(
intmax_t
)
wrw
->
cliov
);
if
(
*
wrw
->
wfd
>=
0
&&
wrw
->
l
iov
>
0
&&
wrw
->
werr
==
0
)
{
if
(
wrw
->
ciov
<
wrw
->
siov
&&
wrw
->
c
liov
>
0
)
{
bprintf
(
cbuf
,
"
00
%jx
\r\n
"
,
(
intmax_t
)
wrw
->
cliov
);
i
=
strlen
(
cbuf
);
wrw
->
iov
[
wrw
->
ciov
].
iov_base
=
cbuf
;
wrw
->
iov
[
wrw
->
ciov
].
iov_len
=
i
;
...
...
@@ -126,6 +126,9 @@ WRW_Flush(struct worker *w)
wrw
->
iov
[
wrw
->
niov
].
iov_base
=
cbuf
+
i
-
2
;
wrw
->
iov
[
wrw
->
niov
++
].
iov_len
=
2
;
wrw
->
liov
+=
2
;
}
else
if
(
wrw
->
ciov
<
wrw
->
siov
)
{
wrw
->
iov
[
wrw
->
ciov
].
iov_base
=
cbuf
;
wrw
->
iov
[
wrw
->
ciov
].
iov_len
=
0
;
}
i
=
writev
(
*
wrw
->
wfd
,
wrw
->
iov
,
wrw
->
niov
);
if
(
i
!=
wrw
->
liov
)
{
...
...
@@ -211,8 +214,24 @@ WRW_Chunked(struct worker *w)
if
(
wrw
->
niov
+
3
>=
wrw
->
siov
)
(
void
)
WRW_Flush
(
w
);
wrw
->
ciov
=
wrw
->
niov
++
;
wrw
->
cliov
=
wrw
->
liov
;
wrw
->
cliov
=
0
;
assert
(
wrw
->
ciov
<
wrw
->
siov
);
}
void
WRW_EndChunk
(
struct
worker
*
w
)
{
struct
wrw
*
wrw
;
CHECK_OBJ_NOTNULL
(
w
,
WORKER_MAGIC
);
wrw
=
&
w
->
wrw
;
assert
(
wrw
->
ciov
<
wrw
->
siov
);
(
void
)
WRW_Flush
(
w
);
wrw
->
ciov
=
wrw
->
siov
;
(
void
)
WRW_Flush
(
w
);
wrw
->
cliov
=
0
;
WRW_Write
(
w
,
"0
\r\n\r\n
"
,
-
1
);
}
...
...
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