[Asterisk-cvs] asterisk/channels chan_sip.c,1.610,1.611
markster at lists.digium.com
markster at lists.digium.com
Tue Jan 4 00:10:55 CST 2005
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv8775/channels
Modified Files:
chan_sip.c
Log Message:
Allow early exit from traverse (bug #3221)
Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.610
retrieving revision 1.611
diff -u -d -r1.610 -r1.611
--- chan_sip.c 3 Jan 2005 00:51:57 -0000 1.610
+++ chan_sip.c 4 Jan 2005 06:16:04 -0000 1.611
@@ -5731,7 +5731,7 @@
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_cli(fd, FORMAT, "Username", "incoming", "Limit","outgoing","Limit");
- ASTOBJ_CONTAINER_TRAVERSE(&userl, do {
+ ASTOBJ_CONTAINER_TRAVERSE(&userl, 1, do {
ASTOBJ_RDLOCK(iterator);
if (iterator->incominglimit)
snprintf(ilimits, sizeof(ilimits), "%d", iterator->incominglimit);
@@ -5774,7 +5774,7 @@
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_cli(fd, FORMAT, "Username", "Secret", "Accountcode", "Def.Context", "ACL", "NAT");
- ASTOBJ_CONTAINER_TRAVERSE(&userl, do {
+ ASTOBJ_CONTAINER_TRAVERSE(&userl, 1, do {
ASTOBJ_RDLOCK(iterator);
ast_cli(fd, FORMAT, iterator->name,
iterator->secret,
@@ -5805,7 +5805,7 @@
return RESULT_SHOWUSAGE;
ast_cli(fd, FORMAT2, "Name/username", "Host", "Dyn", "Nat", "ACL", "Mask", "Port", "Status");
- ASTOBJ_CONTAINER_TRAVERSE(&peerl, do {
+ ASTOBJ_CONTAINER_TRAVERSE(&peerl, 1, do {
char nm[20] = "";
char status[20] = "";
int print_line = -1;
@@ -6029,7 +6029,7 @@
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_cli(fd, FORMAT2, "Host", "Username", "Refresh", "State");
- ASTOBJ_CONTAINER_TRAVERSE(®l, do {
+ ASTOBJ_CONTAINER_TRAVERSE(®l, 1, do {
ASTOBJ_RDLOCK(iterator);
snprintf(host, sizeof(host), "%s:%d", iterator->hostname, iterator->portno ? iterator->portno : DEFAULT_SIP_PORT);
ast_cli(fd, FORMAT, host, iterator->username, iterator->refresh, regstate2str(iterator->regstate));
@@ -8083,12 +8083,12 @@
time(&t);
fastrestart = 0;
curpeernum = 0;
- ASTOBJ_CONTAINER_TRAVERSE(&peerl, do {
+ peer = NULL;
+ ASTOBJ_CONTAINER_TRAVERSE(&peerl, !peer, do {
if ((curpeernum > lastpeernum) && !ast_strlen_zero(iterator->mailbox) && ((t - iterator->lastmsgcheck) > global_mwitime)) {
fastrestart = 1;
lastpeernum = curpeernum;
peer = ASTOBJ_REF(iterator);
- break;
};
curpeernum++;
} while (0)
@@ -9313,7 +9313,7 @@
/*--- sip_poke_all_peers: Send a poke to all known peers */
static void sip_poke_all_peers(void)
{
- ASTOBJ_CONTAINER_TRAVERSE(&peerl, do {
+ ASTOBJ_CONTAINER_TRAVERSE(&peerl, 1, do {
ASTOBJ_WRLOCK(iterator);
sip_poke_peer(iterator);
ASTOBJ_UNLOCK(iterator);
@@ -9324,7 +9324,7 @@
/*--- sip_send_all_registers: Send all known registrations */
static void sip_send_all_registers(void)
{
- ASTOBJ_CONTAINER_TRAVERSE(®l, do {
+ ASTOBJ_CONTAINER_TRAVERSE(®l, 1, do {
ASTOBJ_WRLOCK(iterator);
__sip_do_register(iterator);
ASTOBJ_UNLOCK(iterator);
More information about the svn-commits
mailing list