Changeset 1279:a1685a53fe97 in freeDiameter
- Timestamp:
- Sep 12, 2014, 9:47:38 PM (10 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rt_busypeers/rtbusy.c
r1127 r1279 50 50 struct rt_data * rtd = NULL; 51 51 struct fd_list * candidates = NULL; 52 int sendingattem tps;52 int sendingattempts; 53 53 int resend = 1; 54 54 … … 73 73 ER_DIAMETER_TOO_BUSY, 74 74 &candidates, 75 &sendingattem tps) );75 &sendingattempts) ); 76 76 77 77 /* Now we need to decide if we re-send this query to a different peer or return an error to upstream */ … … 79 79 /* First, are we exceeding the allowed attempts? */ 80 80 if (rtbusy_conf.RetryMaxPeers != 0) { 81 if (sendingattem tps >= rtbusy_conf.RetryMaxPeers) {81 if (sendingattempts >= rtbusy_conf.RetryMaxPeers) { 82 82 TRACE_DEBUG(FULL, "Maximum number of sending attempts reached for message %p, returning an error upstream", qry); 83 83 resend = 0; … … 107 107 /* Send the query again. We need to re-associate the expirecb which was cleaned, if it is used */ 108 108 if (rtbusy_conf.RelayTimeout) { 109 char *buf = NULL; 110 size_t len; 109 111 struct timespec expire; 110 112 CHECK_SYS( clock_gettime(CLOCK_REALTIME, &expire) ); 111 113 expire.tv_sec += rtbusy_conf.RelayTimeout/1000 + ((expire.tv_nsec + (1000000LL * (rtbusy_conf.RelayTimeout % 1000))) / 1000000000LL); 112 114 expire.tv_nsec = (expire.tv_nsec + (1000000LL * (rtbusy_conf.RelayTimeout % 1000))) % 1000000000LL; 115 CHECK_MALLOC_DO( fd_msg_dump_full(&buf, &len, NULL, *pmsg, fd_g_config->cnf_dict, 0, 1), /* nothing */); 116 TRACE_ERROR( "No answer received for message from peer '%.*s' before timeout (%dms), re-sending: %s", senttolen, sentto, 117 rtbusy_conf.RelayTimeout, buf); 118 free(buf); 113 119 CHECK_FCT( fd_msg_send_timeout( pmsg, NULL, NULL, rtbusy_expirecb, &expire ) ); 114 120 } else { … … 118 124 } else { 119 125 if (is_req) { 126 char *buf = NULL; 127 size_t len; 128 129 CHECK_MALLOC_DO( fd_msg_dump_full(&buf, &len, NULL, *pmsg, fd_g_config->cnf_dict, 0, 1), /* nothing */); 130 TRACE_ERROR( "No answer received for message from peer '%.*s' before timeout (%dms), giving up and sending error reply: %s", senttolen, sentto, 131 rtbusy_conf.RelayTimeout, buf); 132 free(buf); 120 133 /* We must create an answer */ 121 134 CHECK_FCT( fd_msg_new_answer_from_req ( fd_g_config->cnf_dict, pmsg, MSGFL_ANSW_ERROR ) );
Note: See TracChangeset
for help on using the changeset viewer.