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
c0d62658
Commit
c0d62658
authored
Feb 06, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate HSH_Complete(), the boc->state takes care of it.
parent
246428b5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
30 deletions
+11
-30
cache.h
bin/varnishd/cache/cache.h
+0
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+0
-1
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+2
-2
cache_hash.c
bin/varnishd/cache/cache_hash.c
+9
-25
hash_slinger.h
bin/varnishd/hash/hash_slinger.h
+0
-1
No files found.
bin/varnishd/cache/cache.h
View file @
c0d62658
...
...
@@ -413,7 +413,6 @@ struct objcore {
uint8_t
flags
;
#define OC_F_BUSY (1<<1)
#define OC_F_PASS (1<<2)
#define OC_F_INCOMPLETE (1<<3)
#define OC_F_ABANDON (1<<4)
#define OC_F_PRIVATE (1<<5)
#define OC_F_FAILED (1<<6)
...
...
bin/varnishd/cache/cache_fetch.c
View file @
c0d62658
...
...
@@ -946,7 +946,6 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
if
(
bo
->
fetch_objcore
->
boc
->
state
==
BOS_FINISHED
)
{
AZ
(
bo
->
fetch_objcore
->
flags
&
OC_F_FAILED
);
HSH_Complete
(
bo
->
fetch_objcore
);
VSLb
(
bo
->
vsl
,
SLT_Length
,
"%ju"
,
(
uintmax_t
)
ObjGetLen
(
bo
->
wrk
,
bo
->
fetch_objcore
));
}
...
...
bin/varnishd/cache/cache_gzip.c
View file @
c0d62658
...
...
@@ -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
->
flags
&
OC_F_INCOMPLETE
)
return
(
0
);
/* No idea about length */
if
(
req
->
objcore
->
boc
!=
NULL
)
return
(
0
);
/* No idea about length
(yet)
*/
p
=
ObjGetAttr
(
req
->
wrk
,
req
->
objcore
,
OA_GZIPBITS
,
&
dl
);
if
(
p
==
NULL
||
dl
!=
32
)
...
...
bin/varnishd/cache/cache_hash.c
View file @
c0d62658
...
...
@@ -91,7 +91,7 @@ hsh_prealloc(struct worker *wrk)
if
(
wrk
->
nobjcore
==
NULL
)
{
wrk
->
nobjcore
=
ObjNew
(
wrk
);
wrk
->
nobjcore
->
flags
|=
OC_F_BUSY
|
OC_F_INCOMPLETE
;
wrk
->
nobjcore
->
flags
|=
OC_F_BUSY
;
}
CHECK_OBJ_NOTNULL
(
wrk
->
nobjcore
,
OBJCORE_MAGIC
);
...
...
@@ -118,7 +118,7 @@ HSH_Private(struct worker *wrk)
AN
(
oc
);
oc
->
refcnt
=
1
;
oc
->
objhead
=
private_oh
;
oc
->
flags
|=
OC_F_PRIVATE
|
OC_F_BUSY
|
OC_F_INCOMPLETE
;
oc
->
flags
|=
OC_F_PRIVATE
|
OC_F_BUSY
;
Lck_Lock
(
&
private_oh
->
mtx
);
VTAILQ_INSERT_TAIL
(
&
private_oh
->
objcs
,
oc
,
list
);
private_oh
->
refcnt
++
;
...
...
@@ -613,25 +613,6 @@ HSH_Fail(struct objcore *oc)
Lck_Lock
(
&
oh
->
mtx
);
oc
->
flags
|=
OC_F_FAILED
;
oc
->
flags
&=
~
OC_F_INCOMPLETE
;
Lck_Unlock
(
&
oh
->
mtx
);
}
/*---------------------------------------------------------------------
* Remove the busyobj from an objcore
*/
void
HSH_Complete
(
struct
objcore
*
oc
)
{
struct
objhead
*
oh
;
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
oh
=
oc
->
objhead
;
CHECK_OBJ
(
oh
,
OBJHEAD_MAGIC
);
Lck_Lock
(
&
oh
->
mtx
);
oc
->
flags
&=
~
OC_F_INCOMPLETE
;
Lck_Unlock
(
&
oh
->
mtx
);
}
...
...
@@ -725,10 +706,13 @@ HSH_RefBoc(const struct objcore *oc)
assert
(
oc
->
refcnt
>
0
);
boc
=
oc
->
boc
;
CHECK_OBJ_ORNULL
(
boc
,
BOC_MAGIC
);
if
(
boc
!=
NULL
&&
boc
->
state
<
BOS_FINISHED
)
if
(
boc
!=
NULL
)
{
assert
(
boc
->
refcount
>
0
);
if
(
boc
->
state
<
BOS_FINISHED
)
boc
->
refcount
++
;
else
boc
=
NULL
;
}
Lck_Unlock
(
&
oh
->
mtx
);
return
(
boc
);
}
...
...
bin/varnishd/hash/hash_slinger.h
View file @
c0d62658
...
...
@@ -104,7 +104,6 @@ struct objhead {
void
HSH_Fail
(
struct
objcore
*
);
void
HSH_Unbusy
(
struct
worker
*
,
struct
objcore
*
);
void
HSH_Complete
(
struct
objcore
*
oc
);
void
HSH_DeleteObjHead
(
struct
worker
*
,
struct
objhead
*
oh
);
int
HSH_DerefObjHead
(
struct
worker
*
,
struct
objhead
**
poh
);
int
HSH_DerefObjCore
(
struct
worker
*
,
struct
objcore
**
ocp
);
...
...
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