Changeset 1078:74bba7975864 in freeDiameter for libfdproto
- Timestamp:
- Apr 30, 2013, 4:37:57 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libfdproto
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdproto/CMakeLists.txt
r922 r1078 13 13 log.c 14 14 messages.c 15 msg_log.c16 15 ostr.c 17 16 portability.c -
libfdproto/dispatch.c
r1017 r1078 97 97 CHECK_FCT_DO( (r = (*hdl->cb)(msg, avp, sess, hdl->opaque, action)), 98 98 { 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)); 100 100 fd_msg_free(*msg); 101 101 *msg = NULL; -
libfdproto/messages.c
r1062 r1078 129 129 DiamId_t msg_src_id; /* Diameter Id of the peer this message was received from. This string is malloc'd and must be freed */ 130 130 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 */133 131 134 132 }; … … 734 732 } 735 733 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 747 734 if (!msg->msg_model) { 748 735 … … 998 985 999 986 /* 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 988 void fd_msg_dump_full_TODO ( int level, struct dictionary *dict, const char *prefix, msg_or_avp *obj ) 1001 989 { 1002 990 msg_or_avp * ref = obj; … … 1361 1349 1362 1350 /* 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));1411 1351 return 0; 1412 1352 } … … 2639 2579 *action = DISP_ACT_ERROR; 2640 2580 } 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); 2642 2582 fd_msg_free(*msg); 2643 2583 *msg = NULL;
Note: See TracChangeset
for help on using the changeset viewer.