diff options
author | mnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-14 16:14:35 +0000 |
---|---|---|
committer | mnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-14 16:14:35 +0000 |
commit | d933e2b265bb1db9d673dc1c8b08fc4ed34f8bc2 (patch) | |
tree | f463b1e14026931c0eb91af12a957199030797f8 /main/udptl.c | |
parent | b978a4a48ae23882c84804087fa96b67c4f43699 (diff) |
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/trunk@240078 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/udptl.c')
-rw-r--r-- | main/udptl.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/main/udptl.c b/main/udptl.c index fdcb3ab77..20b80bd89 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: |