Mercurial > hg > freeDiameter
diff extensions/dbg_rt/dbg_rt.c @ 1119:79dd22145f52
Fix a number of compilation warnings
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Tue, 14 May 2013 11:04:20 +0800 |
parents | 2091bf698fb1 |
children | 1af09cc156d6 |
line wrap: on
line diff
--- a/extensions/dbg_rt/dbg_rt.c Tue May 14 09:56:36 2013 +0800 +++ b/extensions/dbg_rt/dbg_rt.c Tue May 14 11:04:20 2013 +0800 @@ -45,12 +45,15 @@ /* Proxying debug callback */ static int dbgrt_fwd_cb(void * cbdata, struct msg ** msg) { + char * buf = NULL; size_t buflen; TRACE_ENTRY("%p %p", cbdata, msg); - fd_log_debug("[dbg_rt] FWD routing message: %p", msg ? *msg : NULL); - if (msg) - fd_msg_dump_walk(INFO, *msg); - + LOG_D("[dbg_rt] FWD routing message: %p", msg ? *msg : NULL); + if (msg) { + CHECK_MALLOC( fd_msg_dump_treeview(&buf, &buflen, NULL, *msg, NULL, 0, 1) ); + LOG_D("%s", buf); + } + free(buf); return 0; } @@ -58,16 +61,18 @@ static int dbgrt_out_cb(void * cbdata, struct msg * msg, struct fd_list * candidates) { struct fd_list * li; + char * buf = NULL; size_t buflen; TRACE_ENTRY("%p %p %p", cbdata, msg, candidates); - fd_log_debug("[dbg_rt] OUT routing message: %p", msg); - fd_msg_dump_walk(INFO, msg); - fd_log_debug("[dbg_rt] Current list of candidates (%p): (score - id)", msg); + LOG_D("[dbg_rt] OUT routing message: %p", msg); + CHECK_MALLOC( fd_msg_dump_treeview(&buf, &buflen, NULL, msg, NULL, 0, 1) ); + LOG_D("%s", buf); + LOG_D("[dbg_rt] Current list of candidates (%p): (score - id)", msg); for (li = candidates->next; li != candidates; li = li->next) { struct rtd_candidate *c = (struct rtd_candidate *) li; - fd_log_debug("[dbg_rt] %d -\t%s", c->score, c->diamid); + LOG_D("[dbg_rt] %d -\t%s", c->score, c->diamid); } return 0;