From 4faa3b65abad58a20c5e7e401361d30188460a83 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 17 Aug 2004 22:54:16 +0000 Subject: Better message handling when buffer runs out of memory. --- daemon/usuals.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'daemon/usuals.h') diff --git a/daemon/usuals.h b/daemon/usuals.h index 020db4a..b97c85d 100644 --- a/daemon/usuals.h +++ b/daemon/usuals.h @@ -30,6 +30,16 @@ #define RETURN(x) { ret = (x); goto finally; } +/* + * To be used like this: + * if(CHECK_BUF(b)) + * return HA_CRITERROR; + */ + +#define CHECK_BUF(b) (ha_buferr(b) ? (ha_memerr(NULL), 1) : 0) +#define CHECK_RBUF(rq) (ha_buferr((rq)->buf) ? (ha_memerr(rq), 1) : 0) + + #ifdef _DEBUG #include "assert.h" #define ASSERT assert -- cgit v1.2.3