mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-04 03:20:33 +00:00
Ensure chan->fdno always gets reset to -1 after handling a channel fd event.
Since setting fdno to -1 had to be moved, a couple of other code paths that do process an fd event return early and do not pass through the code path where it was moved to. So, set it to -1 in a few other places, too. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2105,12 +2105,14 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
|
|||||||
/* save a copy of func/data before unlocking the channel */
|
/* save a copy of func/data before unlocking the channel */
|
||||||
int (*func)(const void *) = chan->timingfunc;
|
int (*func)(const void *) = chan->timingfunc;
|
||||||
void *data = chan->timingdata;
|
void *data = chan->timingdata;
|
||||||
|
chan->fdno = -1;
|
||||||
ast_channel_unlock(chan);
|
ast_channel_unlock(chan);
|
||||||
func(data);
|
func(data);
|
||||||
} else {
|
} else {
|
||||||
blah = 0;
|
blah = 0;
|
||||||
ioctl(chan->timingfd, DAHDI_TIMERCONFIG, &blah);
|
ioctl(chan->timingfd, DAHDI_TIMERCONFIG, &blah);
|
||||||
chan->timingdata = NULL;
|
chan->timingdata = NULL;
|
||||||
|
chan->fdno = -1;
|
||||||
ast_channel_unlock(chan);
|
ast_channel_unlock(chan);
|
||||||
}
|
}
|
||||||
/* cannot 'goto done' because the channel is already unlocked */
|
/* cannot 'goto done' because the channel is already unlocked */
|
||||||
@@ -2128,6 +2130,7 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
|
|||||||
chan->generator->generate(chan, tmp, -1, -1);
|
chan->generator->generate(chan, tmp, -1, -1);
|
||||||
chan->generatordata = tmp;
|
chan->generatordata = tmp;
|
||||||
f = &ast_null_frame;
|
f = &ast_null_frame;
|
||||||
|
chan->fdno = -1;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2185,7 +2188,7 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
|
|||||||
ast_log(LOG_WARNING, "No read routine on channel %s\n", chan->name);
|
ast_log(LOG_WARNING, "No read routine on channel %s\n", chan->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reset the recorded file descriptor that triggered this read so that we can
|
* Reset the recorded file descriptor that triggered this read so that we can
|
||||||
* easily detect when ast_read() is called without properly using ast_waitfor().
|
* easily detect when ast_read() is called without properly using ast_waitfor().
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user