aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-14 16:19:41 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-14 16:19:41 +0000
commitc6f578190d925fc0d1b901b8fa431cd428fba82a (patch)
tree68611d4886a2bb747df070fb896bf5df1d8e239c
parent4d3251514547ad0f0dd36deb5f5ac7ef63fe0023 (diff)
Merged revisions 240078 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r240078 | mnicholson | 2010-01-14 10:14:35 -0600 (Thu, 14 Jan 2010) | 9 lines This change fixes a few bugs in the way the far max IFP was calculated that were introduced in r231692. (closes issue #16497) Reported by: globalnetinc Patches: udptl-max-ifp-fix1.diff uploaded by mnicholson (license 96) Tested by: globalnetinc ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@240092 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/udptl.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/main/udptl.c b/main/udptl.c
index 492a2de43..24c1a4674 100644
--- a/main/udptl.c
+++ b/main/udptl.c
@@ -802,10 +802,17 @@ static void calculate_far_max_ifp(struct ast_udptl *udptl)
* zero in this loop; we'd rather send smaller IFPs (and thus reduce
* the image data transfer rate) than sacrifice redundancy completely
*/
- for ( ;
- (new_max < 80) && (udptl->error_correction_entries > 1);
- --udptl->error_correction_entries) {
+ for (;;) {
new_max = (udptl->far_max_datagram - 8) / (udptl->error_correction_entries + 1);
+
+ if ((new_max < 80) && (udptl->error_correction_entries > 1)) {
+ /* the max ifp is not large enough, subtract an
+ * error correction entry and calculate again
+ * */
+ --udptl->error_correction_entries;
+ } else {
+ break;
+ }
}
break;
case UDPTL_ERROR_CORRECTION_FEC: