aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-15 19:24:15 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-15 19:24:15 +0000
commit7e219681d6fa3d94f67756bdac3083fec8390613 (patch)
tree3f1d5a67b9594c580f1109a6079770175102b858 /channels
parent12fe3750d5391b928751fcb8dba7b32504125f4b (diff)
Lock network retransmission queue in all places that it is used.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48502 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index ebed2cf3a..da251faa5 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1746,11 +1746,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) {
@@ -2057,8 +2060,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++;
@@ -2066,6 +2072,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());