[asterisk-commits] kpfleming: branch 1.6.0 r210993 - in /branches/1.6.0: ./ main/udptl.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Aug 7 08:09:01 CDT 2009
Author: kpfleming
Date: Fri Aug 7 08:08:57 2009
New Revision: 210993
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=210993
Log:
Merged revisions 210992 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r210992 | kpfleming | 2009-08-07 08:08:00 -0500 (Fri, 07 Aug 2009) | 13 lines
Workaround broken T.38 endpoints that offer tiny MaxDatagram sizes.
Some T.38 endpoints treat T38FaxMaxDatagram as the maximum IFP size that should
be sent to them, rather than the maximum packet payload size. If such an
endpoint also requests UDPRedundancy as the error correction mode, we'll end
up calculating a tiny maximum IFP size, so small as to be unusable. This patch
sets a lower bound on what we'll consider the remote's maximum IFP size to be,
assuming that endpoints that do this really can accept larger packets than
they've offered to accept.
(closes issue #15649)
Reported by: dazza76
........
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/main/udptl.c
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.0/main/udptl.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.0/main/udptl.c?view=diff&rev=210993&r1=210992&r2=210993
==============================================================================
--- branches/1.6.0/main/udptl.c (original)
+++ branches/1.6.0/main/udptl.c Fri Aug 7 08:08:57 2009
@@ -742,28 +742,32 @@
static void calculate_far_max_ifp(struct ast_udptl *udptl)
{
- unsigned new_max = 40;
+ unsigned new_max = 60;
/* calculate the maximum IFP the local endpoint should
* generate based on the far end's maximum datagram size
- * and the current error correction mode
+ * and the current error correction mode. some endpoints
+ * bogus 'max datagram' values that would result in unusable
+ * (too small) maximum IFP values, so we have a a reasonable
+ * minimum value to ensure that we can actually construct
+ * UDPTL packets.
*/
switch (udptl->error_correction_scheme) {
case UDPTL_ERROR_CORRECTION_NONE:
/* only need room for sequence number and length indicators */
- new_max = udptl->far_max_datagram - 6;
+ new_max = MAX(new_max, udptl->far_max_datagram - 6);
break;
case UDPTL_ERROR_CORRECTION_REDUNDANCY:
/* need room for sequence number, length indicators and the
* configured number of redundant packets
*/
- new_max = (udptl->far_max_datagram - 8) / (udptl->error_correction_entries + 1);
+ new_max = MAX(new_max, (udptl->far_max_datagram - 8) / (udptl->error_correction_entries + 1));
break;
case UDPTL_ERROR_CORRECTION_FEC:
/* need room for sequence number, length indicators and a
* a single IFP of the maximum size expected
*/
- new_max = (udptl->far_max_datagram - 10) / 2;
+ new_max = MAX(new_max, (udptl->far_max_datagram - 10) / 2);
break;
}
/* subtract 25% of space for insurance */
More information about the asterisk-commits
mailing list