Commit b47948fc authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Remove the session-specific assert facility, the general assert facility

dumps details now.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2976 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 6e79b313
......@@ -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)
......@@ -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) {
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment