Navigation


Changeset 895:fbf77629cb7b in freeDiameter for libfdcore/p_psm.c


Ignore:
Timestamp:
Nov 30, 2012, 8:44:10 AM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Added received and sent timestamps in the messages; added logs on emission and reception

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/p_psm.c

    r767 r895  
    478478                struct msg * msg = NULL;
    479479                struct msg_hdr * hdr;
     480                struct timespec rcvon;
     481               
     482                /* Retrieve the piggytailed timestamp */
     483                memcpy(&rcvon, ev_data+ev_sz, sizeof(struct timespec));
    480484               
    481485                /* Parse the received buffer */
     
    487491                                goto psm_loop;
    488492                        } );
     493                       
     494                CHECK_FCT_DO( fd_msg_ts_set_recv(msg, &rcvon), /* ... */ );
    489495               
    490496                /* If the current state does not allow receiving messages, just drop it */
     
    515521                        /* Associate */
    516522                        CHECK_FCT_DO( fd_msg_answ_associate( msg, req ), goto psm_end );
     523                       
     524                        /* Display the delay to receive the answer */
     525                        {
     526                                struct timespec reqsent, delay;
     527                                (void) fd_msg_ts_get_sent(req, &reqsent);
     528                                TS_DIFFERENCE( &delay, &reqsent, &rcvon );
     529                                fd_msg_log( FD_MSG_LOG_TIMING, msg, "Answer received in %d.%06.6d sec.", delay.tv_sec, delay.tv_nsec / 1000 );
     530                        }
    517531                }
    518532               
Note: See TracChangeset for help on using the changeset viewer.