Navigation


Changeset 1078:74bba7975864 in freeDiameter for libfdcore/p_out.c


Ignore:
Timestamp:
Apr 30, 2013, 4:37:57 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Cleanup the timing data and fd_msg_log feature that will be replaced by the new hooks mechanism. Kept the calls to fd_msg_log in comments to find the locations easily. WORK IN PROGRESS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/p_out.c

    r1027 r1078  
    4545        int ret;
    4646        uint32_t bkp_hbh = 0;
    47         struct timespec senton;
    4847        struct msg * cpy_for_logs_only;
    4948       
     
    7372        }
    7473       
    75         CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &senton), /* ... */ );
    76         CHECK_FCT_DO( fd_msg_ts_set_sent(cpy_for_logs_only, &senton), /* ... */ );
    77        
    7874        /* Log the message */
    79         fd_msg_log( FD_MSG_LOG_SENT, cpy_for_logs_only, "Sent to '%s'", fd_cnx_getid(cnx));
    80        
    81         {
    82                 struct timespec rcvon, delay;
    83                
    84                 (void) fd_msg_ts_get_recv(cpy_for_logs_only, &rcvon);
    85                 if (rcvon.tv_sec != 0 || rcvon.tv_nsec != 0) {
    86                         TS_DIFFERENCE( &delay, &rcvon, &senton);
    87                         fd_msg_log( FD_MSG_LOG_TIMING, cpy_for_logs_only, "Forwarded in %ld.%6.6ld sec", (long)delay.tv_sec, delay.tv_nsec/1000);
    88                 } else { /* We log the answer time only for answers generated locally */
    89                         if (!msg_is_a_req) {
    90                                 /* get the matching request */
    91                                 struct msg * req;
    92                                 struct timespec reqrcvon;
    93                                 (void) fd_msg_answ_getq(cpy_for_logs_only, &req);
    94                                 (void) fd_msg_ts_get_recv(req, &reqrcvon);
    95                                 TS_DIFFERENCE( &delay, &reqrcvon, &senton);
    96                                 fd_msg_log( FD_MSG_LOG_TIMING, cpy_for_logs_only, "Answered in %ld.%6.6ld sec", (long)delay.tv_sec, delay.tv_nsec/1000);
    97                         }
    98                 }
    99         }
     75        // fd_msg_log( FD_MSG_LOG_SENT, cpy_for_logs_only, "Sent to '%s'", fd_cnx_getid(cnx));
    10076       
    10177        /* Send the message */
     
    12298        CHECK_FCT_DO(fd_fifo_post(fd_g_outgoing, &msg),
    12399                {
    124                         fd_msg_log( FD_MSG_LOG_DROPPED, msg, "An error occurred while attempting to requeue this message during cancellation of the sending function");
     100                        //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "An error occurred while attempting to requeue this message during cancellation of the sending function");
    125101                        CHECK_FCT_DO(fd_msg_free(msg), /* What can we do more? */);
    126102                } );
     
    155131                        {
    156132                                if (msg) {
    157                                         fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error: Problem while sending (%s)", strerror(ret) );
     133                                        //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error: Problem while sending (%s)", strerror(ret) );
    158134                                        fd_msg_free(msg);
    159135                                }
     
    207183                        {
    208184                                if (msg) {
    209                                         fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: Problem while sending (%s)", strerror(ret) );
     185                                        //fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: Problem while sending (%s)", strerror(ret) );
    210186                                        fd_msg_free(*msg);
    211187                                        *msg = NULL;
Note: See TracChangeset for help on using the changeset viewer.