]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 179742 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Tue, 3 Mar 2009 16:48:50 +0000 (16:48 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 3 Mar 2009 16:48:50 +0000 (16:48 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
r179742 | russell | 2009-03-03 10:47:28 -0600 (Tue, 03 Mar 2009) | 14 lines

Merged revisions 179741 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r179741 | russell | 2009-03-03 10:45:46 -0600 (Tue, 03 Mar 2009) | 6 lines

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.6.1@179744 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index 18d757bae705e2ea80b82741b5c6040267b621cf..81472716fc83afb1a6e8788a3bb8c84e669ee901 100644 (file)
@@ -2499,10 +2499,12 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
                                /* save a copy of func/data before unlocking the channel */
                                int (*func)(const void *) = chan->timingfunc;
                                void *data = chan->timingdata;
+                               chan->fdno = -1;
                                ast_channel_unlock(chan);
                                func(data);
                        } else {
                                ast_timer_set_rate(chan->timingfd, 0);
+                               chan->fdno = -1;
                                ast_channel_unlock(chan);
                        }
 
@@ -2526,6 +2528,7 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
                chan->generator->generate(chan, tmp, -1, -1);
                chan->generatordata = tmp;
                f = &ast_null_frame;
+               chan->fdno = -1;
                goto done;
        }
 
@@ -2584,7 +2587,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);
        }
 
-        /*
+       /*
         * 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().
         */