[asterisk-commits] mnicholson: trunk r240078 - /trunk/main/udptl.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 14 10:14:37 CST 2010


Author: mnicholson
Date: Thu Jan 14 10:14:35 2010
New Revision: 240078

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=240078
Log:
This change fixes a few bugs in the way the far max IFP was calculated that were introduced in r231692.

Modified:
    trunk/main/udptl.c

Modified: trunk/main/udptl.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/udptl.c?view=diff&rev=240078&r1=240077&r2=240078
==============================================================================
--- trunk/main/udptl.c (original)
+++ trunk/main/udptl.c Thu Jan 14 10:14:35 2010
@@ -802,10 +802,17 @@
 		 * 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:




More information about the asterisk-commits mailing list