[asterisk-commits] mmichelson: trunk r85965 - /trunk/apps/app_read.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 16 16:38:06 CDT 2007


Author: mmichelson
Date: Tue Oct 16 16:38:05 2007
New Revision: 85965

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85965
Log:
Fixing app_read so that if a timeout of less than 1 ms is specified,
assume that 1 ms is desired.

(closes issue #11000, reported and patched by michael-fig, with a warning line added by me)


Modified:
    trunk/apps/app_read.c

Modified: trunk/apps/app_read.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_read.c?view=diff&rev=85965&r1=85964&r2=85965
==============================================================================
--- trunk/apps/app_read.c (original)
+++ trunk/apps/app_read.c Tue Oct 16 16:38:05 2007
@@ -127,8 +127,14 @@
 		tosec = atof(arglist.timeout);
 		if (tosec <= 0)
 			to = 0;
-		else
+		else {
 			to = tosec * 1000.0;
+			if (to <= 0) {
+				/* Make sure we don't use the default timeout. */
+				ast_log(LOG_WARNING, "Read timeout less than 1 ms, assuming 1 ms timeout\n");
+				to = 1;
+			}
+		}
 	}
 
 	if (ast_strlen_zero(arglist.filename)) {




More information about the asterisk-commits mailing list