Navigation



Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/p_out.c

    r1078 r1027  
    4545        int ret;
    4646        uint32_t bkp_hbh = 0;
     47        struct timespec senton;
    4748        struct msg * cpy_for_logs_only;
    4849       
     
    7273        }
    7374       
     75        CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &senton), /* ... */ );
     76        CHECK_FCT_DO( fd_msg_ts_set_sent(cpy_for_logs_only, &senton), /* ... */ );
     77       
    7478        /* Log the message */
    75         // fd_msg_log( FD_MSG_LOG_SENT, cpy_for_logs_only, "Sent to '%s'", fd_cnx_getid(cnx));
     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        }
    76100       
    77101        /* Send the message */
     
    98122        CHECK_FCT_DO(fd_fifo_post(fd_g_outgoing, &msg),
    99123                {
    100                         //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "An error occurred while attempting to requeue this message during cancellation of the sending function");
     124                        fd_msg_log( FD_MSG_LOG_DROPPED, msg, "An error occurred while attempting to requeue this message during cancellation of the sending function");
    101125                        CHECK_FCT_DO(fd_msg_free(msg), /* What can we do more? */);
    102126                } );
     
    131155                        {
    132156                                if (msg) {
    133                                         //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error: Problem while sending (%s)", strerror(ret) );
     157                                        fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error: Problem while sending (%s)", strerror(ret) );
    134158                                        fd_msg_free(msg);
    135159                                }
     
    183207                        {
    184208                                if (msg) {
    185                                         //fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: Problem while sending (%s)", strerror(ret) );
     209                                        fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: Problem while sending (%s)", strerror(ret) );
    186210                                        fd_msg_free(*msg);
    187211                                        *msg = NULL;
Note: See TracChangeset for help on using the changeset viewer.