Navigation


Changeset 1301:50fb308e84f7 in freeDiameter for libfdcore


Ignore:
Timestamp:
Aug 30, 2015, 2:58:21 AM (9 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

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)

Location:
libfdcore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/hooks.c

    r1299 r1301  
    383383                        }
    384384                       
     385                        case HOOK_MESSAGE_PARSING_ERROR2: {
     386                                CHECK_MALLOC_DO(fd_msg_dump_treeview(&hook_default_buf, &hook_default_len, NULL, msg, NULL, 0, 1), break);
     387
     388                                LOG_E("Returning following message after parsing error:");
     389                                LOG_SPLIT(FD_LOG_ERROR, "   ", hook_default_buf, NULL);
     390                                break;
     391                        }
     392                       
    385393                        case HOOK_MESSAGE_ROUTING_ERROR: {
    386394                                CHECK_MALLOC_DO(fd_msg_dump_treeview(&hook_default_buf, &hook_default_len, NULL, msg, NULL, 0, 1), break);
  • libfdcore/routing_dispatch.c

    r1283 r1301  
    454454                        } else {
    455455                                if (!msgptr) {
     456                                        fd_hook_call(HOOK_MESSAGE_PARSING_ERROR2, error, NULL, NULL, fd_msg_pmdl_get(error));
    456457                                        /* error now contains the answer message to send back */
    457458                                        CHECK_FCT( fd_fifo_post(fd_g_outgoing, &error) );
Note: See TracChangeset for help on using the changeset viewer.