summaryrefslogtreecommitdiff
path: root/omapip/message.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2001-05-17 19:04:09 +0000
committerTed Lemon <source@isc.org>2001-05-17 19:04:09 +0000
commit31bbee784cecf4cd3f985cb6fd880148fcac3733 (patch)
tree138e7cc27349fd99ecfa2995a22775326efbf57f /omapip/message.c
parentcb7cfe5cb72a27d803396fea67f28ef93ef787c2 (diff)
downloadisc-dhcp-31bbee784cecf4cd3f985cb6fd880148fcac3733.tar.gz
Sync with 3.0rc7
Diffstat (limited to 'omapip/message.c')
-rw-r--r--omapip/message.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/omapip/message.c b/omapip/message.c
index 8c0d7f4e..41c1f21f 100644
--- a/omapip/message.c
+++ b/omapip/message.c
@@ -54,13 +54,10 @@ isc_result_t omapi_message_new (omapi_object_t **o, const char *file, int line)
omapi_object_t *g;
isc_result_t status;
- m = dmalloc (sizeof *m, file, line);
- if (!m)
- return ISC_R_NOMEMORY;
- memset (m, 0, sizeof *m);
- m -> type = omapi_type_message;
- rc_register (file, line, &m, m, m -> refcnt);
- m -> refcnt = 1;
+ m = (omapi_message_object_t *)0;
+ status = omapi_message_allocate (&m, file, line);
+ if (status != ISC_R_SUCCESS)
+ return status;
g = (omapi_object_t *)0;
status = omapi_generic_new (&g, file, line);
@@ -84,7 +81,7 @@ isc_result_t omapi_message_new (omapi_object_t **o, const char *file, int line)
}
status = omapi_object_reference (o, (omapi_object_t *)m, file, line);
- omapi_object_dereference ((omapi_object_t **)&m, file, line);
+ omapi_message_dereference (&m, file, line);
omapi_object_dereference (&g, file, line);
if (status != ISC_R_SUCCESS)
return status;
@@ -369,8 +366,37 @@ static const char *omapi_message_op_name(int op) {
}
#endif
+static isc_result_t
+omapi_message_process_internal (omapi_object_t *, omapi_object_t *);
+
isc_result_t omapi_message_process (omapi_object_t *mo, omapi_object_t *po)
{
+ isc_result_t status;
+#if defined (DEBUG_MEMORY_LEAKAGE)
+ unsigned long previous_outstanding = dmalloc_outstanding;
+#endif
+
+ status = omapi_message_process_internal (mo, po);
+
+#if defined (DEBUG_MEMORY_LEAKAGE) && 0
+ log_info ("generation %ld: %ld new, %ld outstanding, %ld long-term",
+ dmalloc_generation,
+ dmalloc_outstanding - previous_outstanding,
+ dmalloc_outstanding, dmalloc_longterm);
+#endif
+#if (defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL)) && 0
+ dmalloc_dump_outstanding ();
+#endif
+#if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY) && 0
+ dump_rc_history ();
+#endif
+
+ return status;
+}
+
+static isc_result_t
+omapi_message_process_internal (omapi_object_t *mo, omapi_object_t *po)
+{
omapi_message_object_t *message, *m;
omapi_object_t *object = (omapi_object_t *)0;
omapi_value_t *tv = (omapi_value_t *)0;