[asterisk-commits] mmichelson: branch mmichelson/timeout_fixes r374072 - /team/mmichelson/timeou...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 28 16:55:41 CDT 2012


Author: mmichelson
Date: Fri Sep 28 16:55:37 2012
New Revision: 374072

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=374072
Log:
Fix some broken logic discovered while testing.


Modified:
    team/mmichelson/timeout_fixes/main/channel.c

Modified: team/mmichelson/timeout_fixes/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/timeout_fixes/main/channel.c?view=diff&rev=374072&r1=374071&r2=374072
==============================================================================
--- team/mmichelson/timeout_fixes/main/channel.c (original)
+++ team/mmichelson/timeout_fixes/main/channel.c Fri Sep 28 16:55:37 2012
@@ -3010,6 +3010,7 @@
 					ast_debug(2, "Didn't receive a media frame from %s within %d ms of answering. Continuing anyway\n", chan->name, MAX(delay, 500));
 					break;
 				}
+				res = 0;
 				cur = ast_read(chan);
 				if (!cur || ((cur->frametype == AST_FRAME_CONTROL) &&
 					     (cur->subclass.integer == AST_CONTROL_HANGUP))) {
@@ -3514,7 +3515,13 @@
 
 int ast_waitfor(struct ast_channel *c, int ms)
 {
-	ast_waitfor_nandfds(&c, 1, NULL, 0, NULL, NULL, &ms);
+	int orig_ms = ms;
+
+	if (!ast_waitfor_nandfds(&c, 1, NULL, 0, NULL, NULL, &ms)) {
+		return ms;
+	} else if (orig_ms < 0 && ms < 0) {
+		ms = 0;
+	}
 	return ms;
 }
 




More information about the asterisk-commits mailing list