[Asterisk-cvs] asterisk/channels chan_zap.c,1.311,1.312

markster at lists.digium.com markster at lists.digium.com
Wed Jul 28 22:21:00 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory localhost.localdomain:/tmp/cvs-serv21694/channels

Modified Files:
	chan_zap.c 
Log Message:
Don't get stuck looping when looking for CRV's


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.311
retrieving revision 1.312
diff -u -d -r1.311 -r1.312
--- chan_zap.c	28 Jul 2004 18:38:29 -0000	1.311
+++ chan_zap.c	29 Jul 2004 02:07:03 -0000	1.312
@@ -6413,11 +6413,13 @@
 	int trunkgroup;
 	struct zt_pri *pri=NULL;
 #endif	
-	struct zt_pvt *exit;
+	struct zt_pvt *exit, *start, *end;
 	ast_mutex_t *lock;
 	
 	/* Assume we're locking the iflock */
 	lock = &iflock;
+	start = iflist;
+	end = ifend;
 	/* We do signed linear */
 	oldformat = format;
 	format &= (AST_FORMAT_SLINEAR | AST_FORMAT_ULAW);
@@ -6481,6 +6483,8 @@
 				if (pris[x].trunkgroup == trunkgroup) {
 					pri = pris + x;
 					lock = &pri->lock;
+					start = pri->crvs;
+					end = pri->crvend;
 					break;
 				}
 			}
@@ -6588,11 +6592,11 @@
 		if (backwards) {
 			p = p->prev;
 			if (!p)
-				p = ifend;
+				p = end;
 		} else {
 			p = p->next;
 			if (!p)
-				p = iflist;
+				p = start;
 		}
 		/* stop when you roll to the one that we started from */
 		if (p == exit)




More information about the svn-commits mailing list