diff options
author | Mark Michelson <mmichelson@digium.com> | 2012-03-02 01:33:06 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2012-03-02 01:33:06 +0000 |
commit | fc558d28f249148b97b6df4d9650924cb7966413 (patch) | |
tree | 4d0213746b62e19bf8693df63f61438e75839a9a /channels/chan_iax2.c | |
parent | 4094a9f57e6c2163543d3204ec527fb7d4f431c6 (diff) |
Fix race condition that can cause important control frames (such as a hangup) to be missed.
This takes two actions.
1. Move the reading of the alertpipe in __ast_read() to immediately before the
removal of frames from the readq. This means we won't do something silly like
read from the alertpipe, then ignore the fact that there's a frame to get from
the readq since channel's fdno is the AST_TIMING_FD.
2. When ast_settimeout() sets the rate to 0 and the timingfunc to NULL, if the
channel's fdno is the AST_TIMING_FD, then set the fdno to -1. This is because
if the rate is 0 and the timingfunc is NULL, it means that the channel's timing
fd is being invalidated, so any pending reads should not occur.
This may actually solve more issues than the referenced one below, but it's not
known at this time for sure.
(closes issue ASTERISK-19223)
reported by Frank-Michael Wittig
Review: https://reviewboard.asterisk.org/r/1779
........
Merged revisions 357761 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 357762 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_iax2.c')
0 files changed, 0 insertions, 0 deletions