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
ea518c69
Commit
ea518c69
authored
Aug 12, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a OF_IMSCAND flag at set it when we create the object, and replace
the duplicated test for :status, Last-Modified and ETag.
parent
716810bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+7
-2
obj_attr.h
include/tbl/obj_attr.h
+1
-0
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
ea518c69
...
...
@@ -397,6 +397,7 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
static
enum
fetch_step
vbf_stp_fetch
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
)
{
char
*
p
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
...
...
@@ -483,6 +484,11 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
if
(
bo
->
do_gzip
||
bo
->
do_gunzip
)
ObjSetFlag
(
bo
->
vfc
,
OF_CHGGZIP
,
1
);
if
(
http_IsStatus
(
bo
->
beresp
,
200
)
&&
(
http_GetHdr
(
bo
->
beresp
,
H_Last_Modified
,
&
p
)
||
http_GetHdr
(
bo
->
beresp
,
H_ETag
,
&
p
)))
ObjSetFlag
(
bo
->
vfc
,
OF_IMSCAND
,
1
);
if
(
bo
->
htc
.
body_status
!=
BS_NONE
)
V1F_Setup_Fetch
(
bo
);
...
...
@@ -865,8 +871,7 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
oldobj
=
ObjGetObj
(
oldoc
,
&
wrk
->
stats
);
CHECK_OBJ_NOTNULL
(
oldobj
,
OBJECT_MAGIC
);
if
(
http_GetHdr
(
oldobj
->
http
,
H_Last_Modified
,
NULL
)
||
http_GetHdr
(
oldobj
->
http
,
H_ETag
,
NULL
))
{
if
(
ObjCheckFlag
(
oldoc
,
&
req
->
wrk
->
stats
,
OF_IMSCAND
))
{
assert
(
oldoc
->
refcnt
>
0
);
HSH_Ref
(
oldoc
);
bo
->
ims_obj
=
oldobj
;
...
...
include/tbl/obj_attr.h
View file @
ea518c69
...
...
@@ -45,6 +45,7 @@ OBJ_ATTR(LASTMODIFIED, lastmodified)
/* upper, lower, val */
OBJ_FLAG
(
GZIPED
,
gziped
,
(
1
<<
1
))
OBJ_FLAG
(
CHGGZIP
,
chggzip
,
(
1
<<
2
))
OBJ_FLAG
(
IMSCAND
,
imscand
,
(
1
<<
3
))
#endif
/*lint -restore */
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