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
393762be
Commit
393762be
authored
Jan 19, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add VFP_Extend() to pair with VFP_GetStorage() for general sanity
parent
b98d1b05
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
9 deletions
+17
-9
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_busyobj.c
bin/varnishd/cache/cache_busyobj.c
+3
-3
cache_esi_fetch.c
bin/varnishd/cache/cache_esi_fetch.c
+1
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+3
-3
cache_fetch_proc.c
bin/varnishd/cache/cache_fetch_proc.c
+8
-1
cache_filter.h
bin/varnishd/cache/cache_filter.h
+1
-0
No files found.
bin/varnishd/cache/cache.h
View file @
393762be
...
...
@@ -670,7 +670,7 @@ double BAN_Time(const struct ban *ban);
/* cache_busyobj.c */
struct
busyobj
*
VBO_GetBusyObj
(
struct
worker
*
,
const
struct
req
*
);
void
VBO_DerefBusyObj
(
struct
worker
*
wrk
,
struct
busyobj
**
busyobj
);
void
VBO_extend
(
struct
busyobj
*
,
ssize_t
);
void
VBO_extend
(
struct
objcore
*
,
struct
busyobj
*
,
ssize_t
);
ssize_t
VBO_waitlen
(
struct
worker
*
,
struct
objcore
*
,
struct
busyobj
*
,
ssize_t
l
);
void
VBO_setstate
(
struct
busyobj
*
bo
,
enum
busyobj_state_e
next
);
...
...
bin/varnishd/cache/cache_busyobj.c
View file @
393762be
...
...
@@ -221,16 +221,16 @@ VBO_DerefBusyObj(struct worker *wrk, struct busyobj **pbo)
}
void
VBO_extend
(
struct
busyobj
*
bo
,
ssize_t
l
)
VBO_extend
(
struct
objcore
*
oc
,
struct
busyobj
*
bo
,
ssize_t
l
)
{
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
vfc
,
VFP_CTX_MAGIC
);
if
(
l
==
0
)
return
;
assert
(
l
>
0
);
Lck_Lock
(
&
bo
->
mtx
);
ObjExtend
(
bo
->
wrk
,
bo
->
vfc
->
oc
,
l
);
ObjExtend
(
bo
->
wrk
,
oc
,
l
);
AZ
(
pthread_cond_broadcast
(
&
bo
->
cond
));
Lck_Unlock
(
&
bo
->
mtx
);
}
...
...
bin/varnishd/cache/cache_esi_fetch.c
View file @
393762be
...
...
@@ -96,7 +96,7 @@ vfp_vep_callback(struct vfp_ctx *vc, void *priv, ssize_t l, enum vgz_flag flg)
i
=
VGZ_Gzip
(
vef
->
vgz
,
&
dp
,
&
dl
,
flg
);
VGZ_UpdateObj
(
vc
,
vef
->
vgz
,
VUA_UPDATE
);
vef
->
tot
+=
dl
;
V
BO_extend
(
vc
->
bo
,
dl
);
V
FP_Extend
(
vc
,
dl
);
}
while
(
i
!=
VGZ_ERROR
&&
(
!
VGZ_IbufEmpty
(
vef
->
vgz
)
||
VGZ_ObufFull
(
vef
->
vgz
)));
assert
(
i
==
VGZ_ERROR
||
VGZ_IbufEmpty
(
vef
->
vgz
));
...
...
bin/varnishd/cache/cache_fetch.c
View file @
393762be
...
...
@@ -511,7 +511,7 @@ vbf_fetch_body_helper(struct busyobj *bo)
vfps
=
VFP_Suck
(
vfc
,
ptr
,
&
l
);
if
(
l
>
0
&&
vfps
!=
VFP_ERROR
)
{
bo
->
acct
.
beresp_bodybytes
+=
l
;
V
BO_extend
(
bo
,
l
);
V
FP_Extend
(
vfc
,
l
);
if
(
est
>=
l
)
est
-=
l
;
else
...
...
@@ -711,7 +711,7 @@ vbf_objiterator(void *priv, int flush, const void *ptr, ssize_t len)
if
(
len
<
l
)
l
=
len
;
memcpy
(
pd
,
ps
,
l
);
V
BO_extend
(
bo
,
l
);
V
FP_Extend
(
bo
->
vfc
,
l
);
ps
+=
l
;
len
-=
l
;
}
...
...
@@ -851,7 +851,7 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
if
(
VFP_GetStorage
(
bo
->
vfc
,
&
l
,
&
ptr
)
!=
VFP_OK
)
break
;
memcpy
(
ptr
,
VSB_data
(
synth_body
)
+
o
,
l
);
V
BO_extend
(
bo
,
l
);
V
FP_Extend
(
bo
->
vfc
,
l
);
ll
-=
l
;
o
+=
l
;
}
...
...
bin/varnishd/cache/cache_fetch_proc.c
View file @
393762be
...
...
@@ -72,7 +72,6 @@ VFP_GetStorage(struct vfp_ctx *vc, ssize_t *sz, uint8_t **ptr)
{
ssize_t
l
;
CHECK_OBJ_NOTNULL
(
vc
,
VFP_CTX_MAGIC
);
AN
(
sz
);
assert
(
*
sz
>=
0
);
...
...
@@ -94,6 +93,14 @@ VFP_GetStorage(struct vfp_ctx *vc, ssize_t *sz, uint8_t **ptr)
return
(
VFP_OK
);
}
void
VFP_Extend
(
const
struct
vfp_ctx
*
vc
,
ssize_t
sz
)
{
CHECK_OBJ_NOTNULL
(
vc
,
VFP_CTX_MAGIC
);
VBO_extend
(
vc
->
oc
,
vc
->
bo
,
sz
);
}
/**********************************************************************
*/
...
...
bin/varnishd/cache/cache_filter.h
View file @
393762be
...
...
@@ -84,6 +84,7 @@ enum vfp_status VFP_Error(struct vfp_ctx *, const char *fmt, ...)
/* cache_fetch_proc.c */
enum
vfp_status
VFP_GetStorage
(
struct
vfp_ctx
*
,
ssize_t
*
sz
,
uint8_t
**
ptr
);
void
VFP_Extend
(
const
struct
vfp_ctx
*
,
ssize_t
sz
);
/* Deliver processors ------------------------------------------------*/
...
...
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