# HG changeset patch # User Sebastien Decugis # Date 1368409599 -28800 # Node ID 7ee7b95701c9d6562456bc2dae3c661dbc2dad38 # Parent 96f2051215c81e3f815ebd377c1456db404ada46 Change the rt_busy parameter to milliseconds diff -r 96f2051215c8 -r 7ee7b95701c9 doc/rt_busypeers.conf.sample --- a/doc/rt_busypeers.conf.sample Sun May 12 16:39:07 2013 +0200 +++ b/doc/rt_busypeers.conf.sample Mon May 13 09:46:39 2013 +0800 @@ -39,7 +39,7 @@ # Parameter: RelayTimeout -# If the value of this parameter is not 0, it specifies the number of seconds that the local relay waits for an answer to a +# If the value of this parameter is not 0, it specifies the number of milliseconds (1/1000 s) that the local relay waits for an answer to a # forwarded request before considering the remote peer is busy and taking corrective action (similar as if that relay had returned TOO_BUSY status). # Note: this parameter does not apply for requests issued locally. In that case, the extension issuing the request should directly specify the timeout. # Default: 0, meaning that there is no timeout parameter. diff -r 96f2051215c8 -r 7ee7b95701c9 extensions/rt_busypeers/rtbusy.c --- a/extensions/rt_busypeers/rtbusy.c Sun May 12 16:39:07 2013 +0200 +++ b/extensions/rt_busypeers/rtbusy.c Mon May 13 09:46:39 2013 +0800 @@ -106,7 +106,7 @@ } /* Send the query again. We need to re-associate the expirecb which was cleaned, if it is used */ if (rtbusy_conf.RelayTimeout) { - struct timespec tm = { .tv_sec = rtbusy_conf.RelayTimeout, .tv_nsec=0 }; + struct timespec tm = { .tv_sec = rtbusy_conf.RelayTimeout/1000, .tv_nsec=1000000LL * (rtbusy_conf.RelayTimeout % 1000) }; CHECK_FCT( fd_msg_send_timeout( pmsg, NULL, NULL, rtbusy_expirecb, &tm ) ); } else { CHECK_FCT( fd_msg_send(pmsg, NULL, NULL) ); @@ -117,7 +117,7 @@ /* We must create an answer */ CHECK_FCT( fd_msg_new_answer_from_req ( fd_g_config->cnf_dict, pmsg, MSGFL_ANSW_ERROR ) ); - CHECK_FCT( fd_msg_rescode_set(*pmsg, "DIAMETER_TOO_BUSY", "[rt_busypeers] Timeout reached while waiting for an anwer", NULL, 1 ) ); + CHECK_FCT( fd_msg_rescode_set(*pmsg, "DIAMETER_TOO_BUSY", "[rt_busypeers] Timeout reached while waiting for an answer", NULL, 1 ) ); CHECK_FCT( fd_msg_send(pmsg, NULL, NULL) ); } @@ -148,7 +148,7 @@ /* If the message is a request, we only associate the timeout */ if (hdr->msg_flags & CMD_FLAG_REQUEST) { - struct timespec tm = { .tv_sec = rtbusy_conf.RelayTimeout, .tv_nsec=0 }; + struct timespec tm = { .tv_sec = rtbusy_conf.RelayTimeout/1000, .tv_nsec=1000000LL * (rtbusy_conf.RelayTimeout % 1000) }; CHECK_FCT( fd_msg_anscb_associate( *pmsg, NULL, NULL, rtbusy_expirecb, &tm ) ); return 0; }