comparison libfdcore/routing_dispatch.c @ 1301:50fb308e84f7

Added a new hook to allow extensions act on the error messages being returned in case of parsing error (e.g. if some mandatory AVP are expected in error messages)
author Sebastien Decugis <sdecugis@freediameter.net>
date Sun, 30 Aug 2015 01:58:21 +0800
parents f09f16f432e6
children 81af4f5a517a
comparison
equal deleted inserted replaced
1300:3f1e79e1273e 1301:50fb308e84f7
451 if (__ret__ != EBADMSG) { 451 if (__ret__ != EBADMSG) {
452 fd_hook_call(HOOK_MESSAGE_DROPPED, msgptr, NULL, "Error while parsing received answer", fd_msg_pmdl_get(msgptr)); 452 fd_hook_call(HOOK_MESSAGE_DROPPED, msgptr, NULL, "Error while parsing received answer", fd_msg_pmdl_get(msgptr));
453 fd_msg_free(msgptr); 453 fd_msg_free(msgptr);
454 } else { 454 } else {
455 if (!msgptr) { 455 if (!msgptr) {
456 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR2, error, NULL, NULL, fd_msg_pmdl_get(error));
456 /* error now contains the answer message to send back */ 457 /* error now contains the answer message to send back */
457 CHECK_FCT( fd_fifo_post(fd_g_outgoing, &error) ); 458 CHECK_FCT( fd_fifo_post(fd_g_outgoing, &error) );
458 } else if (!error) { 459 } else if (!error) {
459 /* We have received an invalid answer to our query */ 460 /* We have received an invalid answer to our query */
460 fd_hook_call(HOOK_MESSAGE_DROPPED, msgptr, NULL, "Received answer failed the dictionary / rules parsing", fd_msg_pmdl_get(msgptr)); 461 fd_hook_call(HOOK_MESSAGE_DROPPED, msgptr, NULL, "Received answer failed the dictionary / rules parsing", fd_msg_pmdl_get(msgptr));
"Welcome to our mercurial repository"