Navigation


Changeset 1113:eb4ce68b6e5c in freeDiameter for libfdproto/messages.c


Ignore:
Timestamp:
May 13, 2013, 8:17:13 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Added calls to remaining hooks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/messages.c

    r1103 r1113  
    26702670
    26712671/* Call all dispatch callbacks for a given message */
    2672 int fd_msg_dispatch ( struct msg ** msg, struct session * session, enum disp_action *action, char ** error_code)
     2672int fd_msg_dispatch ( struct msg ** msg, struct session * session, enum disp_action *action, char ** error_code, char ** drop_reason, struct msg ** drop_msg)
    26732673{
    26742674        struct dictionary  * dict;
     
    26842684        if (error_code)
    26852685                *error_code = NULL;
     2686        if (drop_reason)
     2687                *drop_reason = NULL;
    26862688        *action = DISP_ACT_CONT;
    26872689       
     
    26912693       
    26922694        /* First, call the DISP_HOW_ANY callbacks */
    2693         CHECK_FCT_DO( ret = fd_disp_call_cb_int( NULL, msg, NULL, session, action, NULL, NULL, NULL, NULL ), goto out );
     2695        CHECK_FCT_DO( ret = fd_disp_call_cb_int( NULL, msg, NULL, session, action, NULL, NULL, NULL, NULL, drop_reason, drop_msg ), goto out );
    26942696
    26952697        TEST_ACTION_STOP();
     
    27082710                        *action = DISP_ACT_ERROR;
    27092711                } else {
    2710                         //fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: Received this answer to a local query with an unsupported application %d", (*msg)->msg_public.msg_appl);
    2711                         fd_msg_free(*msg);
     2712                        *drop_reason = "Internal error: Received this answer to a local query with an unsupported application";
     2713                        *drop_msg = *msg;
    27122714                        *msg = NULL;
    27132715                }
     
    27402742                       
    27412743                        /* Call the callbacks */
    2742                         CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, avp, session, action, app, cmd, avp->avp_model, enumval ), goto out );
     2744                        CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, avp, session, action, app, cmd, avp->avp_model, enumval, drop_reason, drop_msg ), goto out );
    27432745                        TEST_ACTION_STOP();
    27442746                }
     
    27492751        /* Now call command and application callbacks */
    27502752        CHECK_FCT_DO( ret = fd_dict_disp_cb(DICT_COMMAND, cmd, &cb_list), goto out );
    2751         CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, NULL, session, action, app, cmd, NULL, NULL ), goto out );
     2753        CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, NULL, session, action, app, cmd, NULL, NULL, drop_reason, drop_msg ), goto out );
    27522754        TEST_ACTION_STOP();
    27532755       
    27542756        if (app) {
    27552757                CHECK_FCT_DO( ret = fd_dict_disp_cb(DICT_APPLICATION, app, &cb_list), goto out );
    2756                 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, NULL, session, action, app, cmd, NULL, NULL ), goto out );
     2758                CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, NULL, session, action, app, cmd, NULL, NULL, drop_reason, drop_msg ), goto out );
    27572759                TEST_ACTION_STOP();
    27582760        }
Note: See TracChangeset for help on using the changeset viewer.