Navigation


Changeset 1078:74bba7975864 in freeDiameter for libfdproto


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.

Location:
libfdproto
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/CMakeLists.txt

    r922 r1078  
    1313        log.c
    1414        messages.c
    15         msg_log.c
    1615        ostr.c
    1716        portability.c
  • libfdproto/dispatch.c

    r1017 r1078  
    9797                CHECK_FCT_DO( (r = (*hdl->cb)(msg, avp, sess, hdl->opaque, action)),
    9898                        {
    99                                 fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: a DISPATCH callback returned an error (%s)", strerror(r));
     99                                //fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: a DISPATCH callback returned an error (%s)", strerror(r));
    100100                                fd_msg_free(*msg);
    101101                                *msg = NULL;
  • libfdproto/messages.c

    r1062 r1078  
    129129        DiamId_t                 msg_src_id;            /* Diameter Id of the peer this message was received from. This string is malloc'd and must be freed */
    130130        size_t                   msg_src_id_len;        /* cached length of this string */
    131         struct timespec          msg_ts_rcv;            /* Timestamp when this message was received from the network */
    132         struct timespec          msg_ts_sent;           /* Timestamp when this message was sent to the network */
    133131       
    134132};
     
    734732        }
    735733       
    736         if ((msg->msg_ts_rcv.tv_sec != 0) || (msg->msg_ts_rcv.tv_nsec != 0)) {
    737                 tsoffset += strftime(buftime + tsoffset, sizeof(buftime) - tsoffset, "%D,%T", localtime_r( &msg->msg_ts_rcv.tv_sec , &tm ));
    738                 tsoffset += snprintf(buftime + tsoffset, sizeof(buftime) - tsoffset, ".%6.6ld", msg->msg_ts_rcv.tv_nsec / 1000);
    739                 CHECK_FCT( dump_add_str(outstr, offset, outlen, INOBJHDR "Received: %s|", INOBJHDRVAL, buftime) );
    740         }
    741         if ((msg->msg_ts_sent.tv_sec != 0) || (msg->msg_ts_sent.tv_nsec != 0)) {
    742                 tsoffset += strftime(buftime + tsoffset, sizeof(buftime) - tsoffset, "%D,%T", localtime_r( &msg->msg_ts_sent.tv_sec , &tm ));
    743                 tsoffset += snprintf(buftime + tsoffset, sizeof(buftime) - tsoffset, ".%6.6ld", msg->msg_ts_sent.tv_nsec / 1000);
    744                 CHECK_FCT( dump_add_str(outstr, offset, outlen, INOBJHDR "Sent    : %s|", INOBJHDRVAL, buftime) );
    745         }
    746        
    747734        if (!msg->msg_model) {
    748735               
     
    998985
    999986/* Dump full message */
    1000 void fd_msg_dump_full ( int level, struct dictionary *dict, const char *prefix, msg_or_avp *obj )
     987// TODO: need align with new prototype & behavior
     988void fd_msg_dump_full_TODO ( int level, struct dictionary *dict, const char *prefix, msg_or_avp *obj )
    1001989{
    1002990        msg_or_avp * ref = obj;
     
    13611349       
    13621350        /* done */
    1363         return 0;
    1364 }
    1365 
    1366 int fd_msg_ts_set_recv( struct msg * msg, struct timespec * ts )
    1367 {
    1368         TRACE_ENTRY("%p %p", msg, ts);
    1369        
    1370         /* Check we received valid parameters */
    1371         CHECK_PARAMS( CHECK_MSG(msg) );
    1372         CHECK_PARAMS( ts );
    1373        
    1374         memcpy(&msg->msg_ts_rcv, ts, sizeof(struct timespec));
    1375         return 0;
    1376 }
    1377 
    1378 int fd_msg_ts_get_recv( struct msg * msg, struct timespec * ts )
    1379 {
    1380         TRACE_ENTRY("%p %p", msg, ts);
    1381        
    1382         /* Check we received valid parameters */
    1383         CHECK_PARAMS( CHECK_MSG(msg) );
    1384         CHECK_PARAMS( ts );
    1385        
    1386         memcpy(ts, &msg->msg_ts_rcv, sizeof(struct timespec));
    1387         return 0;
    1388 }
    1389 
    1390 int fd_msg_ts_set_sent( struct msg * msg, struct timespec * ts )
    1391 {
    1392         TRACE_ENTRY("%p %p", msg, ts);
    1393        
    1394         /* Check we received valid parameters */
    1395         CHECK_PARAMS( CHECK_MSG(msg) );
    1396         CHECK_PARAMS( ts );
    1397        
    1398         memcpy(&msg->msg_ts_sent, ts, sizeof(struct timespec));
    1399         return 0;
    1400 }
    1401 
    1402 int fd_msg_ts_get_sent( struct msg * msg, struct timespec * ts )
    1403 {
    1404         TRACE_ENTRY("%p %p", msg, ts);
    1405        
    1406         /* Check we received valid parameters */
    1407         CHECK_PARAMS( CHECK_MSG(msg) );
    1408         CHECK_PARAMS( ts );
    1409        
    1410         memcpy(ts, &msg->msg_ts_sent, sizeof(struct timespec));
    14111351        return 0;
    14121352}
     
    26392579                        *action = DISP_ACT_ERROR;
    26402580                } else {
    2641                         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);
     2581                        //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);
    26422582                        fd_msg_free(*msg);
    26432583                        *msg = NULL;
Note: See TracChangeset for help on using the changeset viewer.