[asterisk-commits] trunk r16617 - /trunk/channels/chan_iax2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Mar 30 17:53:34 MST 2006


Author: file
Date: Thu Mar 30 18:53:32 2006
New Revision: 16617

URL: http://svn.digium.com/view/asterisk?rev=16617&view=rev
Log:
Do not leave a thread in limbo if an error occurs, or if testing packet loss.

Modified:
    trunk/channels/chan_iax2.c

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?rev=16617&r1=16616&r2=16617&view=diff
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Thu Mar 30 18:53:32 2006
@@ -6558,11 +6558,12 @@
 			if (errno != ECONNREFUSED)
 				ast_log(LOG_WARNING, "Error: %s\n", strerror(errno));
 			handle_error();
+			ASTOBJ_CONTAINER_LINK_END(&idlelist, thread);
 			return 1;
 		}
-		if(test_losspct) { /* simulate random loss condition */
-			if( (100.0*rand()/(RAND_MAX+1.0)) < test_losspct) 
-				return 1;
+		if (test_losspct && ((100.0*rand()/(RAND_MAX+1.0)) < test_losspct)) { /* simulate random loss condition */
+			ASTOBJ_CONTAINER_LINK_END(&idlelist, thread); 
+			return 1;
 		}
 		/* Mark as ready and send on its way */
 		thread->iostate = IAX_IOSTATE_READY;



More information about the asterisk-commits mailing list