]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix race condition that can cause important control frames (such as a hangup) to...
authorMark Michelson <mmichelson@digium.com>
Fri, 2 Mar 2012 00:59:18 +0000 (00:59 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 2 Mar 2012 00:59:18 +0000 (00:59 +0000)
commited7570328aa262b16095f651f93cc40081383d02
treef1f0b263732d901519e8657bd7c939f9f7946e16
parent496d1009ddc3e59fbfb00f28cb2bfb1157aca822
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@357761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/channel.c