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
e2944814
Commit
e2944814
authored
Dec 14, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an explicit OC_F_INCOMPLETE flag to limit the amount of code
that needs to know about oc->busyobj semantics
parent
534aeac4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
5 deletions
+8
-5
cache.h
bin/varnishd/cache/cache.h
+1
-0
cache_expire.c
bin/varnishd/cache/cache_expire.c
+1
-1
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+2
-2
cache_hash.c
bin/varnishd/cache/cache_hash.c
+3
-1
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+1
-1
No files found.
bin/varnishd/cache/cache.h
View file @
e2944814
...
...
@@ -404,6 +404,7 @@ struct objcore {
uint16_t
flags
;
#define OC_F_BUSY (1<<1)
#define OC_F_PASS (1<<2)
#define OC_F_INCOMPLETE (1<<3)
#define OC_F_PRIVATE (1<<8)
#define OC_F_FAILED (1<<9)
...
...
bin/varnishd/cache/cache_expire.c
View file @
e2944814
...
...
@@ -231,7 +231,7 @@ EXP_Touch(struct objcore *oc, double now)
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
if
(
oc
->
busyobj
!=
NULL
)
if
(
oc
->
flags
&
OC_F_INCOMPLETE
)
return
;
if
(
now
-
oc
->
last_lru
<
cache_param
->
lru_interval
)
...
...
bin/varnishd/cache/cache_gzip.c
View file @
e2944814
...
...
@@ -307,8 +307,8 @@ VDP_gunzip(struct req *req, enum vdp_action act, void **priv,
http_Unset
(
req
->
resp
,
H_Content_Encoding
);
req
->
resp_len
=
-
1
;
if
(
req
->
objcore
->
busyobj
!=
NULL
)
return
(
0
);
/* Incomplete, n
o idea about length */
if
(
req
->
objcore
->
flags
&
OC_F_INCOMPLETE
)
return
(
0
);
/* N
o idea about length */
p
=
ObjGetattr
(
req
->
wrk
,
req
->
objcore
,
OA_GZIPBITS
,
&
dl
);
if
(
p
==
NULL
||
dl
!=
32
)
...
...
bin/varnishd/cache/cache_hash.c
View file @
e2944814
...
...
@@ -75,7 +75,7 @@ hsh_NewObjCore(struct worker *wrk)
ALLOC_OBJ
(
oc
,
OBJCORE_MAGIC
);
XXXAN
(
oc
);
wrk
->
stats
->
n_objectcore
++
;
oc
->
flags
|=
OC_F_BUSY
;
oc
->
flags
|=
OC_F_BUSY
|
OC_F_INCOMPLETE
;
return
(
oc
);
}
...
...
@@ -650,6 +650,7 @@ HSH_Fail(struct objcore *oc)
Lck_Lock
(
&
oh
->
mtx
);
oc
->
flags
|=
OC_F_FAILED
;
oc
->
flags
&=
~
OC_F_INCOMPLETE
;
oc
->
busyobj
=
NULL
;
Lck_Unlock
(
&
oh
->
mtx
);
}
...
...
@@ -669,6 +670,7 @@ HSH_Complete(struct objcore *oc)
Lck_Lock
(
&
oh
->
mtx
);
oc
->
busyobj
=
NULL
;
oc
->
flags
&=
~
OC_F_INCOMPLETE
;
Lck_Unlock
(
&
oh
->
mtx
);
}
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
e2944814
...
...
@@ -670,7 +670,7 @@ VRT_r_resp_is_streaming(VRT_CTX)
if
(
ctx
->
req
->
objcore
==
NULL
)
return
(
0
);
/* When called from vcl_synth */
CHECK_OBJ_NOTNULL
(
ctx
->
req
->
objcore
,
OBJCORE_MAGIC
);
return
(
ctx
->
req
->
objcore
->
busyobj
!=
NULL
?
1
:
0
);
return
(
ctx
->
req
->
objcore
->
flags
&
OC_F_INCOMPLETE
?
1
:
0
);
}
/*--------------------------------------------------------------------*/
...
...
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