# HG changeset patch # User Sebastien Decugis # Date 1364786854 -28800 # Node ID d69612a1692986ef914869759dc7f9c5f4f52870 # Parent dc7d6d5f93d369f7565e1fbc8e8fb6d82ee73d26 Do not abort dispatch thread when a callback returns an error diff -r dc7d6d5f93d3 -r d69612a16929 libfdproto/dispatch.c --- a/libfdproto/dispatch.c Fri Mar 29 17:31:46 2013 +0800 +++ b/libfdproto/dispatch.c Mon Apr 01 11:27:34 2013 +0800 @@ -70,6 +70,7 @@ struct dict_object * obj_app, struct dict_object * obj_cmd, struct dict_object * obj_avp, struct dict_object * obj_enu) { struct fd_list * senti, *li; + int r; TRACE_ENTRY("%p %p %p %p %p %p %p %p %p", cb_list, msg, avp, sess, action, obj_app, obj_cmd, obj_avp, obj_enu); CHECK_PARAMS(msg && action); @@ -93,7 +94,13 @@ continue; /* We have a match, the cb must be called. */ - CHECK_FCT( (*hdl->cb)(msg, avp, sess, hdl->opaque, action) ); + CHECK_FCT_DO( (r = (*hdl->cb)(msg, avp, sess, hdl->opaque, action)), + { + fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: a DISPATCH callback returned an error (%s)", strerror(r)); + fd_msg_free(*msg); + *msg = NULL; + } + ); if (*action != DISP_ACT_CONT) break;