Mercurial > hg > freeDiameter-dtls
changeset 1218:876cb3e4d738
Merged
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Tue, 18 Jun 2013 12:46:14 +0800 |
parents | 1e8267ad057c (current diff) b1c4876b1896 (diff) |
children | 8802d3fa5876 |
files | |
diffstat | 4 files changed, 14 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/extensions/dbg_interactive/messages.i Tue Jun 18 12:46:01 2013 +0800 +++ b/extensions/dbg_interactive/messages.i Tue Jun 18 12:46:14 2013 +0800 @@ -341,7 +341,7 @@ } void set_rtd(struct rt_data *DISOWN) { struct rt_data * r = DISOWN; - int ret = fd_msg_rt_associate($self, &r); + int ret = fd_msg_rt_associate($self, r); if (ret != 0) { DI_ERROR(ret, NULL, NULL); }
--- a/include/freeDiameter/libfdproto.h Tue Jun 18 12:46:01 2013 +0800 +++ b/include/freeDiameter/libfdproto.h Tue Jun 18 12:46:14 2013 +0800 @@ -314,7 +314,12 @@ */ #ifdef DEBUG # define LOG_A(format,args... ) \ - LOG(FD_LOG_ANNOYING,format,##args) + do { if ((fd_debug_one_function && !strcmp(fd_debug_one_function, __PRETTY_FUNCTION__)) \ + || (fd_debug_one_file && !strcmp(fd_debug_one_file, __STRIPPED_FILE__) ) ) { \ + LOG(FD_LOG_DEBUG,"[DBG_MATCH] " format,##args); \ + } else { \ + LOG(FD_LOG_ANNOYING,format,##args); \ + } } while (0) #else /* DEBUG */ # define LOG_A(format,args... ) /* not defined in release */ #endif /* DEBUG */ @@ -374,10 +379,7 @@ /* Helper for tracing the CHECK_* macros below -- very very verbose code execution! */ #define TRACE_CALL( str... ) \ - if ((fd_debug_one_function && !strcmp(fd_debug_one_function, __PRETTY_FUNCTION__)) \ - || (fd_debug_one_file && !strcmp(fd_debug_one_file, __STRIPPED_FILE__) ) ) { \ - LOG_A( str ); \ - } + LOG_A( str ) /* For development only, to keep track of TODO locations in the code */ #ifndef ERRORS_ON_TODO @@ -2501,7 +2503,7 @@ * 0 : ok * EINVAL: a parameter is invalid */ -int fd_msg_rt_associate( struct msg * msg, struct rt_data ** rtd ); +int fd_msg_rt_associate( struct msg * msg, struct rt_data * rtd ); int fd_msg_rt_get ( struct msg * msg, struct rt_data ** rtd ); /*
--- a/libfdcore/routing_dispatch.c Tue Jun 18 12:46:01 2013 +0800 +++ b/libfdcore/routing_dispatch.c Tue Jun 18 12:46:14 2013 +0800 @@ -942,6 +942,9 @@ /* Go to next AVP */ CHECK_FCT( fd_msg_browse(avp, MSG_BRW_NEXT, &avp, NULL) ); } + + /* Save the routing information in the message */ + CHECK_FCT( fd_msg_rt_associate ( msgptr, rtd ) ); } /* Note: we reset the scores and pass the message to the callbacks, maybe we could re-use the saved scores when we have received an error ? -- TODO */ @@ -985,9 +988,6 @@ /* Order the candidate peers by score attributed by the callbacks */ CHECK_FCT( fd_rtd_candidate_reorder(candidates) ); - /* Save the routing information in the message */ - CHECK_FCT( fd_msg_rt_associate ( msgptr, &rtd ) ); - /* Now try sending the message */ for (li = candidates->prev; li != candidates; li = li->prev) { struct fd_peer * peer;
--- a/libfdproto/messages.c Tue Jun 18 12:46:01 2013 +0800 +++ b/libfdproto/messages.c Tue Jun 18 12:46:14 2013 +0800 @@ -1297,14 +1297,13 @@ } /* Associate routing lists */ -int fd_msg_rt_associate( struct msg * msg, struct rt_data ** rtd ) +int fd_msg_rt_associate( struct msg * msg, struct rt_data * rtd ) { TRACE_ENTRY( "%p %p", msg, rtd ); CHECK_PARAMS( CHECK_MSG(msg) && rtd ); - msg->msg_rtdata = *rtd; - *rtd = NULL; + msg->msg_rtdata = rtd; return 0; } @@ -1316,7 +1315,6 @@ CHECK_PARAMS( CHECK_MSG(msg) && rtd ); *rtd = msg->msg_rtdata; - msg->msg_rtdata = NULL; return 0; }