summaryrefslogtreecommitdiff
path: root/daemon/usuals.h
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-08-17 22:54:16 +0000
committerStef Walter <stef@memberwebs.com>2004-08-17 22:54:16 +0000
commit4faa3b65abad58a20c5e7e401361d30188460a83 (patch)
tree5c6bd3f1f2c9cc65ec9fc8d6a22824cde8fc40a1 /daemon/usuals.h
parent2888f640a34e34d5a85841976fb8937c4a7774a0 (diff)
Better message handling when buffer runs out of memory.
Diffstat (limited to 'daemon/usuals.h')
-rw-r--r--daemon/usuals.h10
1 files changed, 10 insertions, 0 deletions
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