Changeset 1207:043b894b0511 in freeDiameter for libfdcore/p_sr.c
- Timestamp:
- Jun 14, 2013, 6:30:42 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/p_sr.c
r1188 r1207 38 38 /* Structure to store a sent request */ 39 39 struct sentreq { 40 struct fd_list chain; /* the "o" field points directly to the hop-by-hop of the request (uint32_t *) */40 struct fd_list chain; /* the "o" field points directly to the (new) hop-by-hop of the request (uint32_t *) */ 41 41 struct msg *req; /* A request that was sent and not yet answered. */ 42 uint32_t prevhbh;/* The value to set in the hbh header when the message is retrieved */42 uint32_t prevhbh;/* The value to set back in the hbh header when the message is retrieved */ 43 43 struct fd_list expire; /* the list of expiring requests */ 44 44 struct timespec added_on; /* the time the request was added */ … … 66 66 struct timespec now; 67 67 68 if (!TRACE_BOOL(ANNOYING)) 69 return; 70 71 fd_log_debug("%sSentReq list @%p:", text, srlist); 68 LOG_D("%sSentReq list @%p:", text, srlist); 72 69 73 70 CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &now), ); … … 77 74 uint32_t * nexthbh = li->o; 78 75 79 fd_log_debug(" - Next req (hbh:%x): [since %ld.%06ld sec]", *nexthbh,76 LOG_D(" - Next req (hbh:0x%x, prev:0x%x): [since %ld.%06ld sec]", *nexthbh, sr->prevhbh, 80 77 (long)((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)), 81 78 (long)((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))); … … 225 222 next = find_or_next(&srlist->srs, *hbhloc, &match); 226 223 if (match) { 227 TRACE_DEBUG(INFO, "A request with the same hop-by-hop Id was already sent: error");224 TRACE_DEBUG(INFO, "A request with the same hop-by-hop Id (0x%x) was already sent: error", *hbhloc); 228 225 free(sr); 226 srl_dump("Current list of SR: ", &srlist->srs); 229 227 CHECK_POSIX_DO( pthread_mutex_unlock(&srlist->mtx), /* ignore */ ); 230 228 return EINVAL; … … 235 233 fd_list_insert_before(next, &sr->chain); 236 234 srlist->cnt++; 237 srl_dump("Saved new request, ", &srlist->srs);238 235 239 236 /* In case of request with a timeout, also store in the timeout list */ … … 280 277 /* Search the request in the list */ 281 278 CHECK_POSIX( pthread_mutex_lock(&srlist->mtx) ); 282 srl_dump("Fetching a request, ", &srlist->srs);283 279 sr = (struct sentreq *)find_or_next(&srlist->srs, hbh, &match); 284 280 if (!match) { 285 281 TRACE_DEBUG(INFO, "There is no saved request with this hop-by-hop id (%x)", hbh); 282 srl_dump("Current list of SR: ", &srlist->srs); 286 283 *req = NULL; 287 284 } else {
Note: See TracChangeset
for help on using the changeset viewer.