Navigation


Changeset 688:8c3dc8584dab in freeDiameter for libfdcore/routing_dispatch.c


Ignore:
Timestamp:
Jan 19, 2011, 7:05:30 PM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Prepared capability for messages logging to separate files / folders

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/routing_dispatch.c

    r686 r688  
    409409
    410410                        if (!peer) {
    411                                 TRACE_DEBUG(INFO, "Unable to send error '%s' to deleted peer '%s' in reply to:", error_code, id);
    412                                 fd_msg_dump_walk(INFO, *pmsg);
     411                                fd_msg_log(FD_MSG_LOG_DROPPED, *pmsg, "Unable to send error '%s' to deleted peer '%s' in reply to this message.", error_code, id);
    413412                                fd_msg_free(*pmsg);
    414413                                *pmsg = NULL;
     
    467466                        }
    468467                        if (*pmsg) {    /* another error happen'd */
    469                                 TRACE_DEBUG(INFO, "An unexpected error occurred (%s), discarding a message:", strerror(ret));
    470                                 fd_msg_dump_walk(INFO, *pmsg);
     468                                fd_msg_log( FD_MSG_LOG_DROPPED, *pmsg,  "An unexpected error occurred while parsing the message (%s)", strerror(ret));
    471469                                CHECK_FCT_DO( fd_msg_free(*pmsg), /* continue */);
    472470                                *pmsg = NULL;
     
    522520                               
    523521                                if (!is_req) {
    524                                         TRACE_DEBUG(INFO, "Received an answer to a localy issued query, but no handler processed this answer!");
    525                                         fd_msg_dump_walk(INFO, *pmsg);
     522                                        fd_msg_log( FD_MSG_LOG_DROPPED, *pmsg,  "Internal error: Answer received to locally issued request, but not handled by any handler.");
    526523                                        fd_msg_free(*pmsg);
    527524                                        *pmsg = NULL;
     
    748745                for (   li = (is_req ? rt_fwd_list.next : rt_fwd_list.prev) ; *pmsg && (li != &rt_fwd_list) ; li = (is_req ? li->next : li->prev) ) {
    749746                        struct rt_hdl * rh = (struct rt_hdl *)li;
     747                        int ret;
    750748
    751749                        if (is_req && (rh->dir > RT_FWD_ALL))
     
    756754                        /* Ok, call this cb */
    757755                        TRACE_DEBUG(ANNOYING, "Calling next FWD callback on %p : %p", *pmsg, rh->rt_fwd_cb);
    758                         CHECK_FCT_DO( (*rh->rt_fwd_cb)(rh->cbdata, pmsg),
     756                        CHECK_FCT_DO( ret = (*rh->rt_fwd_cb)(rh->cbdata, pmsg),
    759757                                {
    760                                         TRACE_DEBUG(INFO, "A FWD routing callback returned an error, message discarded.");
    761                                         fd_msg_dump_walk(INFO, *pmsg);
     758                                        fd_msg_log( FD_MSG_LOG_DROPPED, *pmsg, "Internal error: a FWD routing callback returned an error (%s)", strerror(ret));
    762759                                        fd_msg_free(*pmsg);
    763760                                        *pmsg = NULL;
     
    817814                fd_cpu_flush_cache();
    818815                if ((!peer) || (peer->p_hdr.info.runtime.pir_state != STATE_OPEN)) {
    819                         TRACE_DEBUG(INFO, "Unable to forward answer message to peer '%s', deleted or not in OPEN state.", qry_src);
    820                         fd_msg_dump_walk(INFO, *pmsg);
     816                        fd_msg_log( FD_MSG_LOG_DROPPED, *pmsg, "Unable to forward answer to deleted / closed peer '%s'.", qry_src);
    821817                        fd_msg_free(*pmsg);
    822818                        *pmsg = NULL;
     
    897893                        CHECK_FCT_DO( ret = (*rh->rt_out_cb)(rh->cbdata, *pmsg, candidates),
    898894                                {
    899                                         TRACE_DEBUG(INFO, "An OUT routing callback returned an error (%s) ! Message discarded.", strerror(ret));
    900                                         fd_msg_dump_walk(INFO, *pmsg);
     895                                        fd_msg_log( FD_MSG_LOG_DROPPED, *pmsg, "Internal error: an OUT routing callback returned an error (%s)", strerror(ret));
    901896                                        fd_msg_free(*pmsg);
    902897                                        *pmsg = NULL;
     
    947942        /* If the message has not been sent, return an error */
    948943        if (*pmsg) {
    949                 TRACE_DEBUG(INFO, "Could not send the following message, replying with UNABLE_TO_DELIVER");
    950                 fd_msg_dump_walk(INFO, *pmsg);
     944                fd_msg_log( FD_MSG_LOG_NODELIVER, *pmsg, "No suitable candidate to route the message to." );
    951945                return_error( pmsg, "DIAMETER_UNABLE_TO_DELIVER", "No suitable candidate to route the message to", NULL);
    952946        }
Note: See TracChangeset for help on using the changeset viewer.