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
d98dee20
Commit
d98dee20
authored
Feb 14, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give busyobj its own VSL staging buffer too.
parent
b7620169
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
23 deletions
+40
-23
cache.h
bin/varnishd/cache/cache.h
+2
-2
cache_busyobj.c
bin/varnishd/cache/cache_busyobj.c
+31
-19
cache_center.c
bin/varnishd/cache/cache_center.c
+3
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+2
-0
cache_hash.c
bin/varnishd/cache/cache_hash.c
+1
-0
r01038.vtc
bin/varnishtest/tests/r01038.vtc
+1
-1
No files found.
bin/varnishd/cache/cache.h
View file @
d98dee20
...
...
@@ -451,8 +451,6 @@ oc_getlru(const struct objcore *oc)
*
* One of these aspects will be how much has been fetched, which
* streaming delivery will make use of.
*
* XXX: many fields from worker needs to move here.
*/
struct
busyobj
{
...
...
@@ -493,6 +491,8 @@ struct busyobj {
double
connect_timeout
;
double
first_byte_timeout
;
double
between_bytes_timeout
;
struct
vsl_log
vsl
[
1
];
};
/* Object structure --------------------------------------------------*/
...
...
bin/varnishd/cache/cache_busyobj.c
View file @
d98dee20
...
...
@@ -98,14 +98,11 @@ VBO_GetBusyObj(struct worker *wrk)
{
struct
vbo
*
vbo
=
NULL
;
uint16_t
nhttp
;
unsigned
http
sz
;
unsigned
sz
;
char
*
p
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
nhttp
=
(
uint16_t
)
cache_param
->
http_max_hdr
;
httpsz
=
HTTP_estimate
(
nhttp
);
if
(
wrk
->
nvbo
!=
NULL
)
{
vbo
=
wrk
->
nvbo
;
wrk
->
nvbo
=
NULL
;
...
...
@@ -123,15 +120,28 @@ VBO_GetBusyObj(struct worker *wrk)
vbo
->
bo
.
vbo
=
vbo
;
p
=
(
void
*
)(
vbo
+
1
);
p
=
(
void
*
)
PRNDUP
(
p
);
assert
(
p
<
vbo
->
end
);
nhttp
=
(
uint16_t
)
cache_param
->
http_max_hdr
;
sz
=
HTTP_estimate
(
nhttp
);
vbo
->
bo
.
bereq
=
HTTP_create
(
p
,
nhttp
);
p
+=
httpsz
;
p
+=
sz
;
p
=
(
void
*
)
PRNDUP
(
p
);
assert
(
p
<
vbo
->
end
);
vbo
->
bo
.
beresp
=
HTTP_create
(
p
,
nhttp
);
p
+=
httpsz
;
if
(
p
>=
vbo
->
end
)
{
fprintf
(
stderr
,
"workspace_backend is at least %jd to small
\n
"
,
(
p
-
vbo
->
end
));
assert
(
p
<
vbo
->
end
);
}
p
+=
sz
;
p
=
(
void
*
)
PRNDUP
(
p
);
assert
(
p
<
vbo
->
end
);
sz
=
cache_param
->
vsl_buffer
;
VSL_Setup
(
vbo
->
bo
.
vsl
,
p
,
sz
);
p
+=
sz
;
p
=
(
void
*
)
PRNDUP
(
p
);
assert
(
p
<
vbo
->
end
);
WS_Init
(
vbo
->
bo
.
ws
,
"bo"
,
p
,
vbo
->
end
-
p
);
return
(
&
vbo
->
bo
);
...
...
@@ -170,13 +180,15 @@ VBO_DerefBusyObj(struct worker *wrk, struct busyobj **pbo)
r
=
--
vbo
->
refcount
;
Lck_Unlock
(
&
vbo
->
mtx
);
if
(
r
==
0
)
{
/* XXX: Sanity checks & cleanup */
memset
(
&
vbo
->
bo
,
0
,
sizeof
vbo
->
bo
);
if
(
r
)
return
;
if
(
cache_param
->
bo_cache
&&
wrk
->
nvbo
==
NULL
)
wrk
->
nvbo
=
vbo
;
else
VBO_Free
(
&
vbo
);
}
WSL_Flush
(
vbo
->
bo
.
vsl
,
0
);
/* XXX: Sanity checks & cleanup */
memset
(
&
vbo
->
bo
,
0
,
sizeof
vbo
->
bo
);
if
(
cache_param
->
bo_cache
&&
wrk
->
nvbo
==
NULL
)
wrk
->
nvbo
=
vbo
;
else
VBO_Free
(
&
vbo
);
}
bin/varnishd/cache/cache_center.c
View file @
d98dee20
...
...
@@ -480,6 +480,7 @@ cnt_error(struct sess *sp, struct worker *wrk, struct req *req)
AZ
(
wrk
->
busyobj
);
wrk
->
busyobj
=
VBO_GetBusyObj
(
wrk
);
wrk
->
busyobj
->
vsl
->
wid
=
sp
->
vsl_id
;
req
->
obj
=
STV_NewObject
(
wrk
,
TRANSIENT_STORAGE
,
cache_param
->
http_resp_size
,
(
uint16_t
)
cache_param
->
http_max_hdr
);
...
...
@@ -1222,7 +1223,6 @@ cnt_miss(struct sess *sp, struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL
(
wrk
->
busyobj
,
BUSYOBJ_MAGIC
);
AZ
(
req
->
obj
);
wrk
->
busyobj
=
VBO_GetBusyObj
(
wrk
);
http_Setup
(
wrk
->
busyobj
->
bereq
,
wrk
->
busyobj
->
ws
);
http_FilterReq
(
sp
,
HTTPH_R_FETCH
);
http_ForceGet
(
wrk
->
busyobj
->
bereq
);
...
...
@@ -1297,6 +1297,7 @@ cnt_pass(struct sess *sp, struct worker *wrk, const struct req *req)
AZ
(
wrk
->
busyobj
);
wrk
->
busyobj
=
VBO_GetBusyObj
(
wrk
);
wrk
->
busyobj
->
vsl
->
wid
=
sp
->
vsl_id
;
http_Setup
(
wrk
->
busyobj
->
bereq
,
wrk
->
busyobj
->
ws
);
http_FilterReq
(
sp
,
HTTPH_R_PASS
);
...
...
@@ -1351,6 +1352,7 @@ cnt_pipe(struct sess *sp, struct worker *wrk, const struct req *req)
wrk
->
acct_tmp
.
pipe
++
;
wrk
->
busyobj
=
VBO_GetBusyObj
(
wrk
);
wrk
->
busyobj
->
vsl
->
wid
=
sp
->
vsl_id
;
http_Setup
(
wrk
->
busyobj
->
bereq
,
wrk
->
busyobj
->
ws
);
http_FilterReq
(
sp
,
0
);
...
...
bin/varnishd/cache/cache_fetch.c
View file @
d98dee20
...
...
@@ -416,6 +416,8 @@ FetchHdr(struct sess *sp, int need_host_hdr, int sendbody)
if
(
vc
->
recycled
)
retry
=
1
;
sp
->
wrk
->
busyobj
->
vsl
->
wid
=
vc
->
vsl_id
;
/*
* Now that we know our backend, we can set a default Host:
* header if one is necessary. This cannot be done in the VCL
...
...
bin/varnishd/cache/cache_hash.c
View file @
d98dee20
...
...
@@ -453,6 +453,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
AZ
(
wrk
->
busyobj
);
wrk
->
busyobj
=
VBO_GetBusyObj
(
wrk
);
wrk
->
busyobj
->
vsl
->
wid
=
sp
->
vsl_id
;
VRY_Validate
(
sp
->
req
->
vary_b
);
if
(
sp
->
req
->
vary_l
!=
NULL
)
...
...
bin/varnishtest/tests/r01038.vtc
View file @
d98dee20
...
...
@@ -45,7 +45,7 @@ server s1 {
txresp -body "foo8"
} -start
varnish v1 -arg "-p workspace_backend=
3072
" -vcl+backend {
varnish v1 -arg "-p workspace_backend=
7k
" -vcl+backend {
sub vcl_fetch {
set beresp.do_esi = true;
}
...
...
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