aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-27 17:33:04 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-27 17:33:04 +0000
commitaf81f929742870c3e0bddc31c57360897084e4fe (patch)
treece1f6e3950b8dc9e6550974cfa09ec6231204a00 /apps
parent3013a31fba26301bd8e4e39fbad29f5463f04d51 (diff)
Fix a problem in ChanSpy where it could get stuck in an infinite loop without
being able to detect that the calling channel hung up. (closes issue #12076, reported by junky, patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@104625 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_chanspy.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 297bbec97..e25389520 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -538,6 +538,12 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
break;
}
+ if (ast_check_hangup(chan)) {
+ ast_channel_unlock(peer);
+ chanspy_ds_free(peer_chanspy_ds);
+ break;
+ }
+
if (peer == chan) {
ast_channel_unlock(peer);
continue;
@@ -633,7 +639,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
peer = NULL;
}
}
- if (res == -1)
+ if (res == -1 || ast_check_hangup(chan))
break;
}