diff options
author | Joshua Colp <jcolp@digium.com> | 2006-12-15 19:26:45 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2006-12-15 19:26:45 +0000 |
commit | 12565be69eeb4d33eed6f3c08598264e6a232e61 (patch) | |
tree | ce93857ab3965a43c30a807a4a9684f31caf8094 | |
parent | 4e427d84bd2dfe4bba575b7f707a77a9d2f1606d (diff) |
Merged revisions 48502 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r48502 | file | 2006-12-15 14:24:15 -0500 (Fri, 15 Dec 2006) | 2 lines
Lock network retransmission queue in all places that it is used.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_iax2.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 0abe9206f..f2661426c 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1788,11 +1788,14 @@ retry: ast_queue_hangup(owner); } + AST_LIST_LOCK(&iaxq.queue); AST_LIST_TRAVERSE(&iaxq.queue, cur, list) { /* Cancel any pending transmissions */ if (cur->callno == pvt->callno) cur->retries = -1; } + AST_LIST_UNLOCK(&iaxq.queue); + if (pvt->reg) pvt->reg->callno = 0; if (!owner) { @@ -2099,8 +2102,11 @@ static int iax2_show_stats(int fd, int argc, char *argv[]) { struct iax_frame *cur; int cnt = 0, dead=0, final=0; + if (argc != 3) return RESULT_SHOWUSAGE; + + AST_LIST_LOCK(&iaxq.queue); AST_LIST_TRAVERSE(&iaxq.queue, cur, list) { if (cur->retries < 0) dead++; @@ -2108,6 +2114,8 @@ static int iax2_show_stats(int fd, int argc, char *argv[]) final++; cnt++; } + AST_LIST_UNLOCK(&iaxq.queue); + ast_cli(fd, " IAX Statistics\n"); ast_cli(fd, "---------------------\n"); ast_cli(fd, "Outstanding frames: %d (%d ingress, %d egress)\n", iax_get_frames(), iax_get_iframes(), iax_get_oframes()); |