From: Russell Bryant Date: Wed, 27 Feb 2008 17:36:50 +0000 (+0000) Subject: Merged revisions 104625 via svnmerge from X-Git-Tag: 1.6.0-beta7~274 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce29e467670c9c844bdd4cfa055c8f3942f09fa7;p=thirdparty%2Fasterisk.git Merged revisions 104625 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104625 | russell | 2008-02-27 11:33:04 -0600 (Wed, 27 Feb 2008) | 4 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@104643 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index faa665789d..70365996e1 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -610,6 +610,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; @@ -738,6 +744,8 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags, peer = NULL; } } + if (res == -1 || ast_check_hangup(chan)) + break; } exit: