mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-24 14:56:58 +00:00
Enforce mailboxes checked in increasing order
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1054 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -4617,6 +4617,8 @@ static void *do_monitor(void *data)
|
|||||||
struct sip_peer *peer;
|
struct sip_peer *peer;
|
||||||
time_t t;
|
time_t t;
|
||||||
int fastrestart =0;
|
int fastrestart =0;
|
||||||
|
int lastpeernum = -1;
|
||||||
|
int curpeernum;
|
||||||
/* Add an I/O event to our UDP socket */
|
/* Add an I/O event to our UDP socket */
|
||||||
if (sipsock > -1)
|
if (sipsock > -1)
|
||||||
ast_io_add(io, sipsock, sipsock_read, AST_IO_IN, NULL);
|
ast_io_add(io, sipsock, sipsock_read, AST_IO_IN, NULL);
|
||||||
@@ -4665,17 +4667,23 @@ restartsearch:
|
|||||||
peer = peerl.peers;
|
peer = peerl.peers;
|
||||||
time(&t);
|
time(&t);
|
||||||
fastrestart = 0;
|
fastrestart = 0;
|
||||||
|
curpeernum = 0;
|
||||||
while(peer) {
|
while(peer) {
|
||||||
if (strlen(peer->mailbox) && ((t - peer->lastmsgcheck) > 10)) {
|
if ((curpeernum > lastpeernum) && strlen(peer->mailbox) && ((t - peer->lastmsgcheck) > 10)) {
|
||||||
sip_send_mwi_to_peer(peer);
|
sip_send_mwi_to_peer(peer);
|
||||||
fastrestart = 1;
|
fastrestart = 1;
|
||||||
|
lastpeernum = curpeernum;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
curpeernum++;
|
||||||
peer = peer->next;
|
peer = peer->next;
|
||||||
}
|
}
|
||||||
/* Remember, sip_send_mwi_to_peer releases the lock if we've called it */
|
/* Remember, sip_send_mwi_to_peer releases the lock if we've called it */
|
||||||
if (!peer)
|
if (!peer) {
|
||||||
|
/* Reset where we come from */
|
||||||
|
lastpeernum = -1;
|
||||||
ast_pthread_mutex_unlock(&peerl.lock);
|
ast_pthread_mutex_unlock(&peerl.lock);
|
||||||
|
}
|
||||||
ast_pthread_mutex_unlock(&monlock);
|
ast_pthread_mutex_unlock(&monlock);
|
||||||
}
|
}
|
||||||
/* Never reached */
|
/* Never reached */
|
||||||
|
Reference in New Issue
Block a user