From d83c12c7ad7d57f774faa31a135c18909e7b4b82 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 20 Jul 2008 11:28:40 +0000 Subject: [PATCH] Remove the session-specific assert facility, the general assert facility dumps details now. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2976 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache.h | 16 ---------------- .../bin/varnishd/cache_acceptor_kqueue.c | 4 ++-- varnish-cache/bin/varnishd/cache_center.c | 2 +- varnish-cache/bin/varnishd/cache_response.c | 2 +- varnish-cache/bin/varnishd/cache_session.c | 6 +++--- 5 files changed, 7 insertions(+), 23 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index 689f61f8..43429e1b 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -710,19 +710,3 @@ Tadd(txt *t, const char *p, int l) t->b = t->e; } } - -#ifdef WITHOUT_ASSERTS -#define spassert(cond) ((void)(cond)) -#else -void panic(const char *, int, const char *, - const struct sess *, const char *, ...); -#define spassert(cond) \ - do { \ - int ok = !!(cond); \ - if (!ok) \ - panic(__FILE__, __LINE__, __func__, sp, \ - "assertion failed: %s\n", #cond); \ - } while (0) -#endif -#define SPAZ(val) spassert((val) == 0) -#define SPAN(val) spassert((val) != 0) diff --git a/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c b/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c index eb5cb67f..3cf319b9 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c +++ b/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c @@ -119,8 +119,8 @@ vca_kev(const struct kevent *kp) sp, (unsigned long)kp->data, kp->flags, (kp->flags & EV_EOF) ? " EOF" : ""); - spassert(sp->id == kp->ident); - spassert(sp->fd == sp->id); + assert(sp->id == kp->ident); + assert(sp->fd == sp->id); if (kp->data > 0) { i = HTC_Rx(sp->htc); if (i == 0) { diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index 37414481..aff6b1da 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -574,7 +574,7 @@ cnt_lookup(struct sess *sp) * We hit a busy object, disembark worker thread and expect * hash code to restart us, still in STP_LOOKUP, later. */ - spassert(sp->objhead != NULL); + assert(sp->objhead != NULL); if (params->diag_bitmap & 0x20) WSP(sp, SLT_Debug, "on waiting list <%s>", sp->objhead->hash); diff --git a/varnish-cache/bin/varnishd/cache_response.c b/varnish-cache/bin/varnishd/cache_response.c index 46f32991..ed3e4185 100644 --- a/varnish-cache/bin/varnishd/cache_response.c +++ b/varnish-cache/bin/varnishd/cache_response.c @@ -169,7 +169,7 @@ RES_WriteObj(struct sess *sp) VSL_stats->n_objwrite++; WRK_Write(sp->wrk, st->ptr, st->len); } - spassert(u == sp->obj->len); + assert(u == sp->obj->len); if (sp->esis > 0) WRK_Write(sp->wrk, "\r\n", -1); } diff --git a/varnish-cache/bin/varnishd/cache_session.c b/varnish-cache/bin/varnishd/cache_session.c index 268904a7..54792c08 100644 --- a/varnish-cache/bin/varnishd/cache_session.c +++ b/varnish-cache/bin/varnishd/cache_session.c @@ -129,7 +129,7 @@ SES_RefSrcAddr(struct sess *sp) sp->srcaddr = NULL; return; } - SPAZ(sp->srcaddr); + AZ(sp->srcaddr); u = crc32_l(sp->addr, strlen(sp->addr)); v = u % nsrchash; ch = &srchash[v]; @@ -329,8 +329,8 @@ SES_Delete(struct sess *sp) sm = sp->mem; CHECK_OBJ_NOTNULL(sm, SESSMEM_MAGIC); - SPAZ(sp->obj); - SPAZ(sp->vcl); + AZ(sp->obj); + AZ(sp->vcl); VSL_stats->n_sess--; ses_relsrcaddr(sp); assert(!isnan(b->first)); -- 2.39.5