mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-04 12:12:48 +00:00
Move the check for chan->fdno == -1 to after the zombie/hangup check.
Many users were finding that their hung up channels were staying up and causing 100% CPU usage. (issue #14723) Reported by: seadweller Patches: 14723_1-4-tip.patch uploaded by mmichelson (license 60) Tested by: falves11, bamby git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2047,6 +2047,13 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Stop if we're a zombie or need a soft hangup */
|
||||||
|
if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan)) {
|
||||||
|
if (chan->generator)
|
||||||
|
ast_deactivate_generator(chan);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
if (chan->fdno == -1) {
|
if (chan->fdno == -1) {
|
||||||
#ifdef AST_DEVMODE
|
#ifdef AST_DEVMODE
|
||||||
ast_log(LOG_ERROR, "ast_read() called with no recorded file descriptor.\n");
|
ast_log(LOG_ERROR, "ast_read() called with no recorded file descriptor.\n");
|
||||||
@@ -2058,13 +2065,6 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
|
|||||||
f = &ast_null_frame;
|
f = &ast_null_frame;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stop if we're a zombie or need a soft hangup */
|
|
||||||
if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan)) {
|
|
||||||
if (chan->generator)
|
|
||||||
ast_deactivate_generator(chan);
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
prestate = chan->_state;
|
prestate = chan->_state;
|
||||||
|
|
||||||
/* Read and ignore anything on the alertpipe, but read only
|
/* Read and ignore anything on the alertpipe, but read only
|
||||||
|
Reference in New Issue
Block a user