]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 240078 via svnmerge from
authorMatthew Nicholson <mnicholson@digium.com>
Thu, 14 Jan 2010 16:19:14 +0000 (16:19 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Thu, 14 Jan 2010 16:19:14 +0000 (16:19 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@240089 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/udptl.c

index c8d97f844ef721d5ad5030646e2a44b3b410892e..c3b126ebc749073e7c8c8f0a95fe946b3a2f7375 100644 (file)
@@ -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: