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
5cd69e08
Commit
5cd69e08
authored
Mar 05, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate obj arg to FetchBody()
Mostly by: martin
parent
5c9d66ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_center.c
bin/varnishd/cache/cache_center.c
+8
-4
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+3
-5
No files found.
bin/varnishd/cache/cache.h
View file @
5cd69e08
...
...
@@ -748,7 +748,7 @@ struct storage *FetchStorage(struct busyobj *, ssize_t sz);
int
FetchError
(
struct
busyobj
*
,
const
char
*
error
);
int
FetchError2
(
struct
busyobj
*
,
const
char
*
error
,
const
char
*
more
);
int
FetchHdr
(
struct
sess
*
sp
,
int
need_host_hdr
,
int
sendbody
);
int
FetchBody
(
struct
worker
*
w
,
struct
busyobj
*
bo
,
struct
object
*
obj
);
int
FetchBody
(
struct
worker
*
w
,
struct
busyobj
*
bo
);
int
FetchReqBody
(
const
struct
sess
*
sp
,
int
sendbody
);
void
Fetch_Init
(
void
);
...
...
bin/varnishd/cache/cache_center.c
View file @
5cd69e08
...
...
@@ -830,8 +830,10 @@ cnt_prepfetch(struct sess *sp, struct worker *wrk, struct req *req)
req
->
storage_hint
=
NULL
;
if
(
bo
->
do_gzip
||
(
bo
->
is_gzip
&&
!
bo
->
do_gunzip
))
AZ
(
bo
->
fetch_obj
);
bo
->
fetch_obj
=
req
->
obj
;
if
(
bo
->
do_gzip
||
(
bo
->
is_gzip
&&
!
bo
->
do_gunzip
))
req
->
obj
->
gziped
=
1
;
if
(
vary
!=
NULL
)
{
...
...
@@ -903,7 +905,8 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
/* Use unmodified headers*/
i
=
FetchBody
(
wrk
,
bo
,
req
->
obj
);
i
=
FetchBody
(
wrk
,
bo
);
bo
->
fetch_obj
=
NULL
;
http_Teardown
(
bo
->
bereq
);
http_Teardown
(
bo
->
beresp
);
...
...
@@ -1115,6 +1118,8 @@ cnt_lookup(struct sess *sp, struct worker *wrk, struct req *req)
/* If we inserted a new object it's a miss */
if
(
oc
->
flags
&
OC_F_BUSY
)
{
CHECK_OBJ_NOTNULL
(
oc
->
busyobj
,
BUSYOBJ_MAGIC
);
assert
(
oc
->
busyobj
==
req
->
busyobj
);
wrk
->
stats
.
cache_miss
++
;
if
(
req
->
vary_l
!=
NULL
)
{
...
...
@@ -1130,7 +1135,6 @@ cnt_lookup(struct sess *sp, struct worker *wrk, struct req *req)
req
->
vary_e
=
NULL
;
req
->
objcore
=
oc
;
CHECK_OBJ_NOTNULL
(
req
->
busyobj
,
BUSYOBJ_MAGIC
);
sp
->
step
=
STP_MISS
;
return
(
0
);
}
...
...
bin/varnishd/cache/cache_fetch.c
View file @
5cd69e08
...
...
@@ -493,18 +493,19 @@ FetchHdr(struct sess *sp, int need_host_hdr, int sendbody)
/*--------------------------------------------------------------------*/
int
FetchBody
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
,
struct
object
*
obj
)
FetchBody
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
)
{
int
cls
;
struct
storage
*
st
;
int
mklen
;
ssize_t
cl
;
struct
http_conn
*
htc
;
struct
object
*
obj
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
AZ
(
bo
->
fetch_obj
);
CHECK_OBJ_NOTNULL
(
bo
->
vbc
,
VBC_MAGIC
);
obj
=
bo
->
fetch_obj
;
CHECK_OBJ_NOTNULL
(
obj
,
OBJECT_MAGIC
);
CHECK_OBJ_NOTNULL
(
obj
->
http
,
HTTP_MAGIC
);
...
...
@@ -525,7 +526,6 @@ FetchBody(struct worker *wrk, struct busyobj *bo, struct object *obj)
AZ
(
bo
->
vgz_rx
);
AZ
(
VTAILQ_FIRST
(
&
obj
->
store
));
bo
->
fetch_obj
=
obj
;
bo
->
fetch_failed
=
0
;
/* XXX: pick up estimate from objdr ? */
...
...
@@ -578,8 +578,6 @@ FetchBody(struct worker *wrk, struct busyobj *bo, struct object *obj)
*/
AZ
(
vfp_nop_end
(
bo
));
bo
->
fetch_obj
=
NULL
;
VSLb
(
bo
->
vsl
,
SLT_Fetch_Body
,
"%u(%s) cls %d mklen %d"
,
bo
->
body_status
,
body_status
(
bo
->
body_status
),
cls
,
mklen
);
...
...
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