Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions bin/varnishd/cache/cache_gzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,9 @@ vdp_gunzip_bytes(struct vdp_ctx *vdc, enum vdp_action act, void **priv,
enum vgzret_e vr;
ssize_t dl;
const void *dp;
struct worker *wrk;
struct vgz *vg;

CHECK_OBJ_NOTNULL(vdc, VDP_CTX_MAGIC);
wrk = vdc->wrk;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
(void)act;

CAST_OBJ_NOTNULL(vg, *priv, VGZ_MAGIC);
Expand Down
4 changes: 0 additions & 4 deletions bin/varnishd/cache/cache_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ hsh_vry_match(const struct req *req, struct objcore *oc, const uint8_t *vary)
static unsigned
hsh_rush_match(const struct req *req)
{
struct objhead *oh;
struct objcore *oc;

oc = req->objcore;
Expand All @@ -416,9 +415,6 @@ hsh_rush_match(const struct req *req)
if (req->vcf != NULL) /* NB: must operate under oh lock. */
return (0);

oh = oc->objhead;
CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);

return (hsh_vry_match(req, oc, NULL));
}

Expand Down
3 changes: 0 additions & 3 deletions bin/varnishd/cache/cache_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,11 +675,8 @@ void
SES_Rel(struct sess *sp)
{
int i;
struct pool *pp;

CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
pp = sp->pool;
CHECK_OBJ_NOTNULL(pp, POOL_MAGIC);

Lck_Lock(&sp->mtx);
assert(sp->refcnt > 0);
Expand Down
3 changes: 0 additions & 3 deletions bin/varnishd/http2/cache_http2_deliver.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ h2_deliver(struct req *req, int sendbody)
{
size_t sz;
const char *r;
struct sess *sp;
struct h2_req *r2;
struct vsb resp[1];
struct vrt_ctx ctx[1];
Expand All @@ -306,8 +305,6 @@ h2_deliver(struct req *req, int sendbody)
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->objcore, OBJCORE_MAGIC);
CAST_OBJ_NOTNULL(r2, req->transport_priv, H2_REQ_MAGIC);
sp = req->sp;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);

VSLb(req->vsl, SLT_RespProtocol, "HTTP/2.0");

Expand Down
6 changes: 6 additions & 0 deletions include/miniobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#define VALID_OBJ(ptr, type_magic) \
((ptr) != NULL && (ptr)->magic == (type_magic))

#ifndef NO_CHECK_OBJ
#define CHECK_OBJ(ptr, type_magic) \
do { \
assert((ptr)->magic == type_magic); \
Expand All @@ -73,6 +74,11 @@
if ((ptr) != NULL) \
assert((ptr)->magic == type_magic); \
} while (0)
#else
#define CHECK_OBJ(ptr, type_magic) (void)0
#define CHECK_OBJ_NOTNULL(ptr, type_magic) (void)0
#define CHECK_OBJ_ORNULL(ptr, type_magic) (void)0
#endif

#define CAST_OBJ(to, from, type_magic) \
do { \
Expand Down
2 changes: 1 addition & 1 deletion vmod/vmod_directors.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ vdir_update_health(VRT_CTX, struct vdir *vd)
be = vd->backend[u];
CHECK_OBJ_NOTNULL(be, DIRECTOR_MAGIC);
c = 0;
h = VRT_Healthy(ctx, vd->backend[u], &c);
h = VRT_Healthy(ctx, be, &c);
if (h) {
nh++;
tw += vd->weight[u];
Expand Down