Changeset 706:4ffbc9f1e922 in freeDiameter for libfdcore/p_sr.c
- Timestamp:
- Feb 9, 2011, 3:26:58 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/p_sr.c
r691 r706 36 36 #include "fdcore-internal.h" 37 37 38 #ifndef SR_DEBUG_LVL39 #define SR_DEBUG_LVL ANNOYING40 #endif /* SR_DEBUG_LVL */41 42 38 /* Structure to store a sent request */ 43 39 struct sentreq { … … 69 65 struct fd_list * li; 70 66 struct timespec now; 71 if (!TRACE_BOOL(SR_DEBUG_LVL)) 67 68 if (!TRACE_BOOL(ANNOYING)) 72 69 return; 70 71 fd_log_debug("%sSentReq list @%p:\n", text, srlist); 72 73 73 CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &now), ); 74 fd_log_debug("%sSentReq list @%p:\n", text, srlist);74 75 75 for (li = srlist->next; li != srlist; li = li->next) { 76 76 struct sentreq * sr = (struct sentreq *)li; 77 77 uint32_t * nexthbh = li->o; 78 fd_log_debug(" - Next req (%x): [since %ld.%06ld sec]\n", *nexthbh, 78 79 fd_log_debug(" - Next req (hbh:%x): [since %ld.%06ld sec]\n", *nexthbh, 79 80 (now.tv_nsec >= sr->added_on.tv_nsec) ? (now.tv_sec - sr->added_on.tv_sec) : (now.tv_sec - sr->added_on.tv_sec - 1), 80 81 (now.tv_nsec >= sr->added_on.tv_nsec) ? (now.tv_nsec - sr->added_on.tv_nsec) / 1000 : (now.tv_nsec - sr->added_on.tv_nsec + 1000000000) / 1000); 81 fd_msg_dump_one(SR_DEBUG_LVL + 1, sr->req); 82 83 fd_msg_dump_one(ANNOYING + 1, sr->req); 82 84 } 83 85 } … … 117 119 } 118 120 119 /* thread that handles messages expiring. The thread is started / cancelledonly when needed */121 /* thread that handles messages expiring. The thread is started only when needed */ 120 122 static void * sr_expiry_th(void * arg) { 121 123 struct sr_list * srlist = arg; … … 129 131 { 130 132 char buf[48]; 131 s printf(buf, "ReqExp/%.*s", (int)sizeof(buf) - 8, ((struct fd_peer *)(srlist->exp.o))->p_hdr.info.pi_diamid);133 snprintf(buf, sizeof(buf), "ReqExp/%s", ((struct fd_peer *)(srlist->exp.o))->p_hdr.info.pi_diamid); 132 134 fd_log_threadname ( buf ); 133 135 } … … 313 315 } else { 314 316 /* Just free the request. */ 315 fd_msg_log( FD_MSG_LOG_DROPPED, sr->req, " Local message discarded during failover" );317 fd_msg_log( FD_MSG_LOG_DROPPED, sr->req, "Sent & unanswered local message discarded during failover." ); 316 318 CHECK_FCT_DO(fd_msg_free(sr->req), /* Ignore */); 317 319 }
Note: See TracChangeset
for help on using the changeset viewer.